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

What does s c mean in text?

0 Answers  


What does %c do in c?

0 Answers  


What is 'bus error'?

0 Answers  


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a<b,printb.find the sum digits of that number & then print.if a==b multiply 10 with a & add 20 with b store in c and then print

0 Answers  


Write a program to generate the first n terms in the series --- 9,11,20,31,...,82

1 Answers   Cognizant,






Explain the use of fflush() function?

0 Answers  


Explain what is a 'locale'?

0 Answers  


In header files whether functions are declared or defined?

1 Answers   TCS,


What is the meaning of this decleration? unsigned char (*pArray[10][10]); please reply.

1 Answers  


What does a function declared as pascal do differently?

0 Answers  


There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,another has combination of apple and orange,what is the least way of interchange the lables.

15 Answers   Cisco, Google, MBT,


What is array in C

0 Answers  


Categories