yogesh patil in dell

Answers were Sorted based on User's Feedback



yogesh patil in dell..

Answer / yogesh

'MERGE CONTENTS OF TWO FILE

Option Explicit
Const conForReading = 1
Const ForAppending = 8


Dim objFSO: Set objFSO = CreateObject
("Scripting.FileSystemObject")
Dim file1,file2,file3,contents1,contents2
Dim strfile1,strfile2,strfile3 'Declare
variables

strfile1=inputbox("Enter path of Source file 1","Copy file
utility"," ")
strfile2=inputbox("Enter path of Source file 2","Copy file
utility"," ")
strfile3=inputbox("Enter path of To Create Target
file","Copy file utility"," ")
Set file1 = objFSO.OpenTextFile(strfile1, conForReading,
False)
Set file2 = objFSO.OpenTextFile(strfile2, conForReading,
False)
Set file3 = objFSO.CreateTextFile(strfile3, ForAppending,
True)

'Set Objects

contents1 = file1.ReadAll
contents2 = file2.ReadAll
'Read file contents

file1.Close
file2.Close
'Close file after use

file3.WriteLine(contents1)
file3.writeLine(contents2)
'Write contents to file

file3.Close
'Close file after use
Set file1 = Nothing
Set file2 = Nothing
Set file3 = Nothing
Set objFSO = Nothing
'freezing memory of objects

Is This Answer Correct ?    1 Yes 0 No

yogesh patil in dell..

Answer / yogesh

option explicit
Dim objFSO: Set objFSO = CreateObject
("Scripting.FileSystemObject")
Dim colDrives:Set colDrives = objFSO.Drives
Dim objDrive,path,s
For Each objDrive in colDrives
path=objDrive.DriveLetter&":"
SearchPath(Path)


Next



Function SearchPath(Path) ' Defination of function
Dim BigFile,BigSize:BigSize=0
Dim objFSO: Set objFSO = CreateObject
("Scripting.FileSystemObject")
Dim objfolder:Set objfolder= objFSO.GetFolder(path &"\")
Dim ColSubFolders:Set ColSubFolders=objfolder.subfolders
Dim ObjSubFolder,objFile,colFiles
For each ObjSubFolder in ColSubFolders
Set colFiles=objfolder.files
For each objFile in colFiles
if(objFile.size>BigSize) then
BigSize=objFile.size
BigFile=objFile.name
end if
next
next
msgbox BigFile &BigSize
End Function

Is This Answer Correct ?    0 Yes 0 No

yogesh patil in dell..

Answer / yogesh

'CREATE FOLDER STRUCTURE

Option Explicit

Dim objFSO:Set objFSO = CreateObject
("Scripting.FileSystemObject")
Dim strDirectory:strDirectory=inputbox("Enter
path ","Create folder utility"," ")

'Declare variables
GeneratePath(strDirectory)
'Call to Function


Function GeneratePath(pFolderPath) ' Defination of function
GeneratePath = False
If Not objFSO.FolderExists(pFolderPath) Then
If GeneratePath(objFSO.GetParentFolderName(pFolderPath))
Then 'Recursive call to function
GeneratePath = True
Call objFSO.CreateFolder(pFolderPath)
End If
Else
GeneratePath = True
End If
End Function

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More C Interview Questions

swap two integer variables without using a third temporary variable?

6 Answers   Persistent,


Symmetric technologies interview questions. For Computer science candidates the first round is a objective type written test consisting of 16 questions.It is very easy ,any police man can solve this. And next round is a written test consists of both objective and subjective .Total 40 question related to c,c++ and operating system related questions. And then a technical interview and give some program to solve with computer.The md is adamant person, whatever he says we have to accept that is the condition. And one more thing ,,,these interview is just for a formality..the company will select only innocent guys.. the person's without a backbone only they require.. And u have to submit the certificates this is the most important problem...So if you are not getting any other jobs..then only join with this... It is better to try for other company...And apart from that symmetric do a lot of projects..If a candidate can manage everything u can join and make good career with this company... The Md will normally speak rudely..but he is good person and he will give you a lot of very good chances to improve your career....but with cheap salary....

0 Answers   Symmetric Technologies,


What is #line used for?

0 Answers  


What is selection sort in c?

0 Answers  


How to print "Hi World" without using semi colon?

6 Answers   Infosys,






Difference between strcpy() and memcpy() function?

0 Answers  


What is the meaning of ?

0 Answers  


Why we use int main and void main?

0 Answers  


What are the advantages of c language?

0 Answers  


How do you write a program which produces its own source code as its output?

4 Answers  


what is the difference b/w NULL and null?

3 Answers   HSBC, IBM,


what is difference between array and structure?

44 Answers   College School Exams Tests, CTS, Google, HCL, IBM, Motorola, TCS,


Categories