Jump to content

Recommended Posts

Posted

I hope all master will help me again.. :evil:

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.. ;)

Posted (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 by 99ojo
Posted

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 :evil:

Posted

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 :evil:

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

Posted

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

Posted (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 by 99ojo
Posted

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?

;-))

Stefan

As i see path c:\users: Try #RequireAdmin in your script

I have add X command

x: eXtract files with full paths

and have try in bat file.. Ok and success

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...