Jump to content

Recommended Posts


Posted

well to take this batch again and this should work

TITLE WindowToClose
(
 ECHO CMDOW.EXE @ /HID
 ECHO ping -n 120 127.0.0.1 ^>nul
 ECHO CMDOW.EXE WindowToClose /CLS
 ECHO EXIT
) > %WINDIR%\CLOSE.CMD

call common.cmd
If /I %computername%==Computer GOTO Comp1 ELSE GOTO Comp2
:Comp1
call Comp1.cmd
GOTO END
:Comp2
call Comp2.cmd
GOTO END
:END
START %WINDIR%\CLOSE.CMD
set /p Install="For a 2cd setup, Press Y"
If %Install%==Y CALL 2cd.cmd
ECHO Done
EXIT

Posted

Sorry I missed some things cause I didn't check it. You also need the ^ for the & symbol too, and double %% for variables. As for your error message, that is because you are deleting the file, but you still haven't exited. You can solve this with and & statement.

TITLE WindowToClose
(
  ECHO CMDOW.EXE @ /HID
  ECHO setlocal ENABLEEXTENSIONS ^& set n=120
  ECHO ping -n %%n%% 127.0.0.1 ^>nul
  ECHO CMDOW.EXE WindowToClose /CLS
  ECHO endlocal
  ECHO DEL /F /Q CLOSE.CMD ^& EXIT
) > %WINDIR%\CLOSE.CMD

call common.cmd
If /I %computername%==Computer GOTO Comp1 ELSE GOTO Comp2
:Comp1
call Comp1.cmd
GOTO END
:Comp2
call Comp2.cmd
GOTO END
:END
START %WINDIR%\CLOSE.CMD
set /p Install="For a 2cd setup, Press Y"
If %Install%==Y CALL 2cd.cmd
ECHO Done

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...