Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Set objFSO=CreateObject("Scripting.FileSystemObject")
Set objShell=CreateObject("WScript.Shell")
Source = "C:\Documents and Settings\user\Desktop\clients\****\t"
Set fileLocation=objFSO.GetFolder(Source)
Destination = "c:\y\"
SubFolderCopy fileLocation
Sub SubFileCopy (fileDir)
on error resume Next
For Each efile in fileDir.Files
objfso.copyfile efile, Destination
objfso.deletefile efile
msgbox ("Files Moved !")
Next
End SubSub SubFolderCopy (fileDir)
SubFileCopy fileDir
For Each efolder In fileDir.subfolders
on Error Resume next
SubFolderCopy efolder
Next
End Subthe above code basically moves the files from a folder to another folder.
it works fine for moving from a defined path.
but in my path if one of the folder is contantly changing and i only want to move the files of the folder and subfolders after this folder what should i do?
for eg. in the code above what should i do to replace those ***** with something(to automate the selection of that folder ) so that it directly copies the files from the fodler "t" and subfolders of it to c:\y.kindly help/
also my message box does not close after clicking ok, i have to pres ok 3-4 times to close it. what can be the problem.cheers

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/2b6287d7-a6e3-40b5-97e4-899932059b28.asp
this link aint useful but has something thati want.
somebody please help
cheers

![]() |
Dos Bat. to edit file (ho...
|
equivalent command for 's...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |