Jump to content

Batch file waits for Notepad to close


Recommended Posts

Hi,

I made a batch file that I put in a WinZip self extractor. The idea is that the zip-file extracts to a folder, and then the bat file gets executed. It copies files to

"C:\Program Files\ShutdownForUPS"

"%UserProfile%\Start Menu\Shutdown For UPS"

and to "%Windir%\System32

After that it needs to delete the original files that the zip-file extracted. I do this by first deleting the files in all folders and subfolders and then deleting the folders itself.

Afterwards I CALL a Readme file, and that is where the problem is. When the ReadMe file is called, the DOS window remains in the background. Only when I close the file, the DOS window closes (end of Bat file).

Is it possible to close the DOS window without closing the Readme file?

Is it also possible to delete the bat file automatically when all is executed???

Here is the bat file

set currentdir=%cd%
mkdir "c:\Program Files\ShutdownForUPS"
copy %currentdir%\shutdownforups\shutdownforups.exe "C:\Program Files\ShutdownForUPS"
copy %currentdir%\shutdownforups\shutdown.bat "C:\Program Files\ShutdownForUPS"
copy %currentdir%\shutdownforups\stop.bat "C:\Program Files\ShutdownForUPS"
copy %currentdir%\shutdownforups\ReadMe.txt "C:\Program Files\ShutdownForUPS"
copy %currentdir%\shutdownforups\shutdown.exe %Windir%\System32
copy %currentdir%\shutdownforups\richtx32.ocx %Windir%\System32
mkdir "%UserProfile%\Menu Start\Programma's\ShutdownForUPS"
copy %currentdir%\shutdownforups\StartMenu\ShutdownForUPS.lnk "%UserProfile%\Menu Start\Programma's\ShutdownForUPS"
rem Call "C:\Program Files\ShutdownForUPS\ReadMe.txt
del %currentdir%\ShutdownForUPS\StartMenu /f /q
del %currentdir%\ShutdownForUPS /f /q
rd %currentdir%\ShutdownForUPS\StartMenu
rd %currentdir%\ShutdownForUPS

Thanks in advance

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy