Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

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

- - - - -

  • Please log in to reply
4 replies to this topic

#1
doestergaard

doestergaard

    Newbie

  • Member
  • 14 posts
  • Joined 15-August 13
  • OS:none specified
  • Country: Country Flag

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

 




How to remove advertisement from MSFN

#2
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,852 posts
  • Joined 28-April 06
  • OS:Windows 7 x86
  • Country: Country Flag

Donator

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


MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
tpxmsfn1_zps393339c1.jpg


#3
allen2

allen2

    Not really Newbie

  • Member
  • PipPipPipPipPipPipPip
  • 1,804 posts
  • Joined 13-January 06

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



#4
doestergaard

doestergaard

    Newbie

  • Member
  • 14 posts
  • Joined 15-August 13
  • OS:none specified
  • Country: Country Flag

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, 29 September 2013 - 05:55 AM.


#5
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,852 posts
  • Joined 28-April 06
  • OS:Windows 7 x86
  • Country: Country Flag

Donator

I did this once, but after the image was complete I show a messagebox asking to reboot. Read up this thread:

http://www.msfn.org/...-of-a-function/


MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
tpxmsfn1_zps393339c1.jpg





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users