yogesh patil in dell
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Where are the auto variables stored?
How to print India by nested loop? I IN IND INDI INDIA
Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?
Are comments included during the compilation stage and placed in the EXE file as well?
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
Define macros.
Why do we need functions in c?
How to delete a node from linked list w/o using collectons?
What is an expression?
Why c is known as a mother language?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
How does normalization of huge pointer works?