2

I made a script to run an old game which has grafic problems when explorer.exe is running. This script kills explorer.exe with taskkill /F /IM explorer.exe and this works fine. But when I run start explorer.exe or Start-Process explorer.exe it doesn't restore my interface (taskbar etc) but opens a singe explorer window. Ho do I restore my GUI with a powershell command?

Thanks!

Edit: source

Mount-DiskImage -ImagePath "D:\Roms\PC\Anno\Anno 1602 KE\Anno 1602 KE.iso"
taskkill /F /IM explorer.exe
Start-Process .\1602.exe -Wait
start explorer.exe
Dismount-DiskImage -ImagePath "D:\Roms\PC\Anno\Anno 1602 KE\Anno 1602 KE.iso"
16
  • I ran those commands and I works very well with me. Please, reedit your question and put the script source code. – Jorge Luiz May 16 '20 at 20:26
  • Done, source added – BDevGW May 16 '20 at 20:27
  • 1
    It's Anno 1602, a game made for win95 which still works with some tweaks (incliding killing explorer.exe / gui) – BDevGW May 16 '20 at 20:40
  • 1
    Which are the Win version running in your computer? – Jorge Luiz May 16 '20 at 20:42
  • 1
    @jluizsouzadev Win 10 x64 Pro version 1909 (up-to-date). – BDevGW May 16 '20 at 20:45
1

Try to rewrite the script like this:

Mount-DiskImage -ImagePath "D:\Roms\PC\Anno\Anno 1602 KE\Anno 1602 KE.iso"

taskkill /F /IM explorer.exe

Start-Process .\1602.exe 

Wait-Process 1602.exe

Start explorer.exe

Dismount-DiskImage -ImagePath "D:\Roms\PC\Anno\Anno 1602 KE\Anno 1602 KE.iso"

Then, run the script again as Administrator.

References:

11
  • tried, same result. No taskbar showing up till I run explorer.exe from the run dialog. – BDevGW May 16 '20 at 20:57
  • Even after 1602.exe to be closed? – Jorge Luiz May 16 '20 at 21:02
  • jep. Wait-Process 1602.exe should wait till it has exited or do I miss something? – BDevGW May 16 '20 at 21:04
  • Yes, it has. Wait-Process does the script wait until to 1602.exe to be finished. – Jorge Luiz May 16 '20 at 21:08
  • so then yes, even after 1602.exe has exited. – BDevGW May 16 '20 at 21:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.