penggilas2 Posted December 9, 2009 Share Posted December 9, 2009 I hope all master will help me again.. this is command in bat file.. @echo off C:\7z.exe x -o%temp%\ghost -y M:\coba\file.7z -o%temp% is set Output directory extract file... -y: assume Yes on all queries M:\file\ghost.7z is my 7zip folder How to convert in auto it script.. I create script like this DirCreate(@TempDir & "\ghost") $tempdir = @TempDir & "\ghost" Run("7z.exe x -0" & Chr (34) & $tempdir & Chr (34) & "-y M:\file\ghost.7z") but not working.. 99ojo, M23, and all master plz help me again.. Link to comment Share on other sites More sharing options...
99ojo Posted December 9, 2009 Share Posted December 9, 2009 (edited) Hi, try: DirCreate(@TempDir & "\ghost") $tempdir = @TempDir & "\ghost" ;changes: -o and added one blank before -y $cmd = "7z.exe x -o" & Chr (34) & $tempdir & Chr (34) & " -y M:\file\ghost.7z" Run($cmd) ;maybe: ;Run (@ComSpec & " /c " & $cmd) ;-)) Stefan P.S: You should debug with generating commandstring and control it via MsgBox instead of Run. So you can see errors much better. Edited December 9, 2009 by 99ojo Link to comment Share on other sites More sharing options...
penggilas2 Posted December 9, 2009 Author Share Posted December 9, 2009 Hi, try: DirCreate(@TempDir & "\ghost") $tempdir = @TempDir & "\ghost" ;changes: -o and added one blank before -y $cmd = "7z.exe x -o" & Chr (34) & $tempdir & Chr (34) & " -y M:\file\ghost.7z" Run($cmd) ;maybe: ;Run (@ComSpec & " /c " & $cmd) ;-)) Stefan P.S: You should debug with generating commandstring and control it via MsgBox instead of Run. So you can see errors much better. I try script.. But I can`t see error list.. P.S: You should debug with generating commandstring and control it via MsgBox instead of Run. So you can see errors much better. Ok I will try to make it.. but if ojo want to give me an example again.. to control msgbox I'll be very happy Link to comment Share on other sites More sharing options...
99ojo Posted December 9, 2009 Share Posted December 9, 2009 I try script.. But I can`t see error list.. P.S: You should debug with generating commandstring and control it via MsgBox instead of Run. So you can see errors much better. Ok I will try to make it.. but if ojo want to give me an example again.. to control msgbox I'll be very happy Hi, i didn't meant program execution errors, but string generating error. What i meant: DirCreate(@TempDir & "\ghost") $tempdir = @TempDir & "\ghost" ;changes: -o and added one blank before -y $cmd = "7z.exe x -o" & Chr (34) & $tempdir & Chr (34) & " -y M:\file\ghost.7z" MsgBox (0,"",$cmd) ; so you would have seen the missing blank before -y ;Run($cmd) ;maybe: ;Run (@ComSpec & " /c " & $cmd) By the way, your problem is solved or not. If not: 1) Did you try the run with @comspec options? 2) You may need full path to 7zip.exe ;-)) Stefan Link to comment Share on other sites More sharing options...
penggilas2 Posted December 9, 2009 Author Share Posted December 9, 2009 Hi, i didn't meant program execution errors, but string generating error. What i meant: DirCreate(@TempDir & "\ghost") $tempdir = @TempDir & "\ghost" ;changes: -o and added one blank before -y $cmd = "7z.exe x -o" & Chr (34) & $tempdir & Chr (34) & " -y M:\file\ghost.7z" MsgBox (0,"",$cmd) ; so you would have seen the missing blank before -y ;Run($cmd) ;maybe: ;Run (@ComSpec & " /c " & $cmd) By the way, your problem is solved or not. If not: 1) Did you try the run with @comspec options? 2) You may need full path to 7zip.exe ;-)) Stefan I have tried all the alternatives,.. Run (@ComSpec & " /c " & $cmd) and Run($cmd) But still error and this is msgbox list.. 7z.exe x -o"C:\users\myname\appdata\temp\ghost"-y M:\file\ghost.7z Link to comment Share on other sites More sharing options...
99ojo Posted December 9, 2009 Share Posted December 9, 2009 (edited) Hi, Chr (34) -> " Btw, in your MsgBox output is still missing a blank, maybe paste and copy error. Have you try full path to 7zip.exe? Have you try to add a working directory? ;-)) Stefan As i see path c:\users: Try #RequireAdmin in your script Edited December 9, 2009 by 99ojo Link to comment Share on other sites More sharing options...
penggilas2 Posted December 9, 2009 Author Share Posted December 9, 2009 Hi,Chr (34) -> "Btw, your MsgBox output is still missing a blank, maybe paste and copy error.Have you try full path to 7zip.exe?Have you try to add a working directory?;-))StefanAs i see path c:\users: Try #RequireAdmin in your scriptI have add X commandx: eXtract files with full pathsand have try in bat file.. Ok and success Link to comment Share on other sites More sharing options...
99ojo Posted December 9, 2009 Share Posted December 9, 2009 so -y and M:\file\ghost.7z must be separated..What does that mean?;-))Stefan Link to comment Share on other sites More sharing options...
penggilas2 Posted December 9, 2009 Author Share Posted December 9, 2009 Ok stefan I`m sorry.. U`r script Is Ok.. I Have write in wrong folder name.. I`m sorry.. U are the best.. Thank`s.. I`m sorry give U a trouble.. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now