I was able to get the following code to work and copy the file(s). I used the same code with different icons (and file names) for a number of different files to move. Here’s the code used:
Then I realized that there is one file that I need to rename before moving it. Each week I copy some timesheet records for a backup. The backup file is originally named "Timesht1.dat". I send it to a DOS/ASCII area where I can open and check the data, save the file, then copy it to a new file with a name such as "TSBK37.dat". It is this last file that I save in my backup folder. I believe my code should have the INPUT box code b/w the third and fourth lines.
I am wanting to click my desktop icon, have an INPUT box or something similar pop up and let me enter the new file name, i.e. “TSBK37.dat” and then move the file to the backup folder upon “ENTER”.
I looked on the MS “Scripting Guys” site ( )
And thought I had something until I read that the code listed only works with XP. The PC that I am using is Win98.
Does anyone know of a way to accomplish the above?
Thanks,
Bill
Code:
Dim Fso, FromWimPC
Set Fso = CreateObject("Scripting.FileSystemObject")
Set FromWimPC = Fso.GetFile("G:\WIM\FileNameGoesHere.dat")
FromWimPC.Copy ("R:\ClientPayrollTimeSheetBackupFiles\")
Then I realized that there is one file that I need to rename before moving it. Each week I copy some timesheet records for a backup. The backup file is originally named "Timesht1.dat". I send it to a DOS/ASCII area where I can open and check the data, save the file, then copy it to a new file with a name such as "TSBK37.dat". It is this last file that I save in my backup folder. I believe my code should have the INPUT box code b/w the third and fourth lines.
I am wanting to click my desktop icon, have an INPUT box or something similar pop up and let me enter the new file name, i.e. “TSBK37.dat” and then move the file to the backup folder upon “ENTER”.
I looked on the MS “Scripting Guys” site ( )
And thought I had something until I read that the code listed only works with XP. The PC that I am using is Win98.
Does anyone know of a way to accomplish the above?
Thanks,
Bill