Jump to content

Recommended Posts

Posted

Hi everyone,

I have 2 identical lines used to extract folders using 7za.exe.

One of them works fine and not the other.

I cannot figure out what is going on with my code and I have already spent 2 days and frustrated.

Hence, seeking help from pros.

Please help.

My code below :
 

FileInstall("C:\Software\LSSAM_CBT.7z", @TempDir & "\LSSAM_CBT.7z", 1)
FileInstall("C:\Software\Maintenance_Tool.7z", @TempDir & "\Maintenance_Tool.7z", 1)
FileInstall("C:\Software\7za.exe", @TempDir & "\7za.exe", 1)
FileInstall("C:\Software\7za.dll", @TempDir & "\7za.dll", 1)

Runwait(@ComSpec & " /c " & @TempDir & "\7za.exe x LSSAM_CBT.7z -o"&@TempDir&" -aoa", "", @SW_HIDE)
Sleep(1000)
Runwait(@ComSpec & " /c " & @TempDir & "\7za.exe x Maintenance_Tool.7z -o"&@TempDir&" -aoa", "", @SW_HIDE)

This line works perfectly :

Runwait(@ComSpec & " /c " & @TempDir & "\7za.exe x LSSAM_CBT.7z -o"&@TempDir&" -aoa", "", @SW_HIDE)

But the below does NOT.

Runwait(@ComSpec & " /c " & @TempDir & "\7za.exe x Maintenance_Tool.7z -o"&@TempDir&" -aoa", "", @SW_HIDE)

Please let me know what is wrong with this, eventhough it is identical to the first one.

Thanks a lot.

Posted
4 minutes ago, JLogan3o13 said:

Change the /c to /k so you can see the output from 7za.

...don't forget to remove the @sw_hide flag too, or you still won't see anything.

Posted

Gents,

Thank you so much for your quick replies.

I changed /c to /k and removed @sw_hide and then got the following.

image.png.de1ce187bc2d1b09082120f70007b044.png

But the file was actually there. (Maintenance_Tool.7z)

image.png.578909dc594d0ed9f31581150bc2e3ff.png

Then I changed the code as below and then it worked.

Runwait(@ComSpec & " /c " & @TempDir & "\7za.exe x ""Maintenance_Tool.7z"" -o" & @TempDir & " -aoa", "", @SW_HIDE)

I enclosed the file name with quotes - ""Maintenance_Tool.7z""
 

Thank you so much all, much appreciated.

This forum is amazing, and people like you are more amazing !!!!

Posted

Thanks Nine - It does not work if you add a space after -o.

The only way I managed it was by enclosing file name with quotes.

Thanks again.

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