TheStoneman
IS-IT--Management
Can someone help me with this problem?
Set fso = CreateObject("Scripting.FileSystemObject")
Set objArgs = WScript.Arguments
For I = 0 to objArgs.Count - 1
WScript.Echo objArgs(I)
Set Myfile = fso.GetFile("WScript.Echo objArgs(I)")
MyFile.Copy ("C:\")
Next
'Set Myfile = fso.GetFile("c:\documents and settings\rstone.act-ia\desktop\test.txt")
I can drag a file and it echos the path and file name but the line to set Myfile says file not found. The commented line at the end works fine. How can I place the results of the WScript.Echo objArgs(I) into the GetFile statement?
Set fso = CreateObject("Scripting.FileSystemObject")
Set objArgs = WScript.Arguments
For I = 0 to objArgs.Count - 1
WScript.Echo objArgs(I)
Set Myfile = fso.GetFile("WScript.Echo objArgs(I)")
MyFile.Copy ("C:\")
Next
'Set Myfile = fso.GetFile("c:\documents and settings\rstone.act-ia\desktop\test.txt")
I can drag a file and it echos the path and file name but the line to set Myfile says file not found. The commented line at the end works fine. How can I place the results of the WScript.Echo objArgs(I) into the GetFile statement?