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

write a program to check whether a number is Peterson or not.

3 Answers  


write a program to print infinte number

4 Answers  


what will be maximum number of comparisons when number of elements are given?

0 Answers  


what is the maximum limit of row and column of a matrix in c programming. in linux .

4 Answers   NIIT,


If "AaBbCc" is passed to the char char x(*a) { a[0]?x(a+1):1; printf("%c",a[0]); return 1; } what will be the output?

6 Answers   Hughes,






Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it?

3 Answers  


1.write a program to merge the arrays 2.write efficient code for extracting unique elements from a sorted list of array?

3 Answers   Qualcomm,


what does keyword ‘extern’ mean in a function declaration?

1 Answers   Emerson,


difference between native and cross compilers

0 Answers  


hello everybody can we change a the adress of a variabl i mean can i put for exemple for a int *p: &p=6 ?????????

1 Answers  


explain what is an endless loop?

0 Answers  


Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

0 Answers   Sikkim Manipal University,


Categories