Set WSHShell = CreateObject("Wscript.Shell")
return = WSHShell.run ("C:\Program Files\7-Zip\7z.exe e C:\ziptest
\test.zip -y -oc:\ziptest *.txt -r",1,true)
return = WSHShell.run( """C:\Program Files\7-Zip\7z.exe"" e ...
I'm still receiving the error that the file cannot be found. I'm
tyring:
return = WSHShell.run( """C:\Program Files\7-Zip\7z.exe"" e C:\ziptest\test.zip
-y -oc:\ziptest *.txt -r",1,true)
One line; the full path has to be quoted. You would make it easier for yourself
if you'd store the command into a variable and WScript.Echo it to check/compare
against a working command line.
Set WSHShell = CreateObject("Wscript.Shell")
return = WSHShell.run ("""C:\Program Files\7-Zip\7z.exe e
C:\ziptest\test.zip -y -oc:\ziptest *.txt -r""",1,true)
-Corey
Set WSHShell = CreateObject("Wscript.Shell")
wscript.echo """C:\Program Files\7-Zip\7z.exe e
C:\ziptest\test.zip -y -oc:\ziptest *.txt -r"""
"Corey Thomas - MCSE/MCSA/MCDBA"
<CoreyThomasM...@discussions.microsoft.com> wrote in message
news:71724248-2EB9-481C...@microsoft.com...
"C:\Program Files\7-Zip\7z.exe e C:\temp\4\7-Zip.7z -y -oc:\temp\4\ *.txt -r"
and i did:
Set shep = WScript.CreateObject("WScript.Shell")
shep.Run """C:\Program Files\7-Zip\7z.exe"" e C:\temp\4\7-Zip.7z -y -oc:\temp\4\ *.txt -r"
and in both cases all worked great :).
if in wsh script we have file paths with "spaces" then we need to embrace those paths with- ""file path"".
in my case it is ""C:\Program Files\7-Zip\7z.exe""
hope this will help :)