Sign in to follow this  
Followers 0
doestergaard

Help needed with VPScript: window.close() terminates cmd.exe in WinPE?

5 posts in this topic

Does anybody know why this happens? I know that WinPE shutdown when you close startcmd, but how can i leave cmd.exe open so it does not shutdown WinPE?

Heres my code:

case 4

oShell.Run("%WINDIR%\System32\cmd.exe")

document.parentwindow.close()

end select

end sub

Thanks in advance :)

0

Share this post


Link to post
Share on other sites

So I guess your code is closing the CMD huh? Is your VBScript being run from the startnet.cmd?

0

Share this post


Link to post
Share on other sites

Cmd alone should also close. You might need to run cmd /k if you want to keep the cmd windows open.

0

Share this post


Link to post
Share on other sites

Thank you for your replies. Haven't had any luck with it yet. Im using Winpeshl.ini to execute mshta and the OSDLoader.hta

It terminates all windows when i tell the script to open the new window. Here is my code for OSDLoader.hta which after initializing the system will execute:

oShell.Run "%WINDIR%\System32\cmd /k cd X:\ & %WINDIR%\OSD\OSDGui.hta", 1, false

self.close()

The OSDGui.hta opens up fine but closes again immediately after self.close() from OSDLoader.hta is being executed and WinPE reboots :huh:

Thanks again! :)

/Daniel

Edited by doestergaard
0

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.