Sn00f Posted November 3, 2004 Posted November 3, 2004 Hi all!I have a little "problem", I would like to hide a batch file then at some moment in it, unhide it. i Explain:I created a shortcut which starts minimized, ok.at the end of the launched cmd file, I would like to start another one but àat this time unhided..cmd number one: (minimised)[some code]::I triedcall %systemdrive%\temp\restard.cmd::oR%systemdrive%\temp\restard.lnk (normal windowed link which launches restart.cmd)but this doesn't work.This is to remotely install some software, and then at the end of installation, ask the user to restart or not.cmd number two (restart.cmd): (should be visible)[some code]:shutdownset choice=SET /P choice=Etes-vous sur(e) d'avoir sauvegard‚ tous vos documents ouverts? (o/n) if not '%choice%'=='' set choice=%choice:~0,5%if '%choice%'=='n' goto exitif '%choice%'=='o' goto shutdown1if '%choice%'=='N' goto exitif '%choice%'=='O' goto shutdown1ECHO "%choice%" n'est pas une entr‚e valide, r‚essayez SVP.ECHO.pauseGOTO shutdownshutdown1call "%SYSTEMROOT%\system32\shutdown.exe" -r 4:exitis this possible?NB: If this can help, I'm working on W2k.
jdoe Posted November 3, 2004 Posted November 3, 2004 Try this.cmd number onerem your code herestart %systemdrive%\temp\restart.cmdexit.cmd number two (restart.cmd)rem your code here:shutdownset choice=""SET /P choice= (o/n)if /i not "%choice%"=="o" goto exit:shutdown1start "%SYSTEMROOT%\system32\shutdown.exe" -r 4:exitexit
Sn00f Posted November 4, 2004 Author Posted November 4, 2004 hi!the "start %systemdrive%\temp\restart.cmd" was enough!thx a lot!I used the call function or just %systemdrive%\temp\restart.cmd, which didn't work.I think I have plenty of things to learn about batch files ;-)It works perfectly (will retry to be sure ;-) )
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now