I have the following script which currently doesn't work. I'm pretty sure it's just a matter of getting the syntax correct for the wshshell.run line but, haven't been able to figure it out yet. Here is the current script:
Thanks for your help!
[!]The AutoSavers![/!]
Code:
Set objDialog = CreateObject("UserAccounts.CommonDialog")
objDialog.InitialDir = "C:\"
intResult = objDialog.ShowOpen
If intResult = 0 Then
MsgBox "You didn't select a file."
Wscript.Quit
Else
End If
Set objShellApp = CreateObject("Shell.Application")
Set objMyComputer = objShellApp.NameSpace (&H11&)
Set objFolder = objShellApp.BrowseForFolder (0, "Browse to the desired folder", 0)
If objFolder = null Then
MsgBox "You didn't select a folder."
Wscript.Quit
Else
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run ("cmd /c xcopy /s /c /d /e /h /i /r /k /y "& objDialog.FileName &" "& objFolder.self.Path &" "),0,True
Wscript.Echo objDialog.FileName & " was copied to " & objFolder.Self.Path
End If
Thanks for your help!
[!]The AutoSavers![/!]