Jump to content

How to make a DOS window stay open


Recommended Posts

How can I get a bat file window to stay open so I can see if there are any errors?

$Var1 = "C:\Dnload\9xAddons\Ultimate Windows Tweaker v 2.1.zip"
Local $sUserName = "Administrator"
Local $sPassword = ""

$Return = RunAsWait($sUserName, @ComputerName, $sPassword, 0,@Comspec & ' /c C:\Dnload\9xAddons\UnZip.bat "' & $Var1 & '"', @SW_MAXIMIZE)

Bat file:

@Echo Off
"C:\Dnload\9xAddons\Batch\7za.exe" e -ao %1 *  

Ping 127.0.0.1 -n 10 > NUL
Pause
CMD

Thank you,

Docfxit

Edited by docfxit
Link to comment
Share on other sites

How can I get a bat file window to stay open so I can see if there are any errors?

$Return = RunAsWait($sUserName, @ComputerName, $sPassword, 0,@Comspec & ' /c C:\Dnload\9xAddons\UnZip.bat "' & $Var1 & '" & "' & $Win7 & '"', @SW_MAXIMIZE)

Change the /c switch to /k

$Return = RunAsWait($sUserName, @ComputerName, $sPassword, 0,@Comspec & ' /k C:\Dnload\9xAddons\UnZip.bat "' & $Var1 & '" & "' & $Win7 & '"', @SW_MAXIMIZE)

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Link to comment
Share on other sites

The cmd window will stay open with this and I get the msg "File UnZipped Correctly"

$Var1 = "C:\Dnload\9xAddons\Ultimate Windows Tweaker v 2.1.zip"
$Return = RunWait(@Comspec & ' /K C:\Dnload\9xAddons\UnZip.bat "' & $Var1 & '"')
If @error Then
    MsgBox(0, "Error unzipping file", "Error code: " & @error & @CRLF & $Var1 & @CRLF & "Return value = " & $Return)
Else
    MsgBox(0, "File UnZipped", "File UnZipped Correctly")
EndIf

The cmd window Not will stay open with this and I get the error msg.

$Var1 = "C:\Dnload\9xAddons\Ultimate Windows Tweaker v 2.1.zip"
Local $sUserName = "Administrator"
Local $sPassword = ""
$Return = RunAsWait($sUserName, @ComputerName, $sPassword, 0,@Comspec & ' /K C:\Dnload\9xAddons\UnZip.bat "' & $Var1 & '"')
If @error Then
    MsgBox(0, "Error unzipping file", "Error code: " & @error & @CRLF & $Var1 & @CRLF & "Return value = " & $Return)
Else
    MsgBox(0, "File UnZipped", "File UnZipped Correctly")
EndIf

Any ideas what I am doing wrong?

Thanks,

Docfxit

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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