home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 41,452 of 42,547   
   foxidrive to alexganegama@gmail.com   
   Re: Syntax checker for MS-DOS batch scri   
   26 May 16 12:20:40   
   
   From: foxidrive@server.invalid   
      
   On 26/05/2016 08:11, alexganegama@gmail.com wrote:   
   > On Tuesday, July 12, 2011 at 1:41:30 AM UTC+10, Alex Stankevich wrote:   
   >   
   > Is something wrong with this?   
      
   Well it has nothing to do with the quoted portion. :)   
      
      
   1) "if else" is not needed and is incorrect syntax.   
      
   2) In all usual cases "goto :EOF" should be the last command in each   
   subroutine, as it stops the execution falling through to the next subroutine.   
      
      
      
   > cls   
   > @ECHO OFF   
   > title Shutdown, Restart or Logoff   
   > echo Would you like to Shutdown, Restart, Logoff or Cancel?   
   > set/p "cho=>"   
   > if %cho%==Restart goto Restart   
   > if %cho%=Shutdown goto Shutdown   
   > if %cho%==Logoff goto Logoff   
   > if %cho%==Cancel goto Cancel   
   > if else goto FAIL   
   >   
   >   
   >   
   >   
   >   
   >   
   >   
   >   
   >   
   >   
   >   
   > :Restart   
   > echo Restarting...   
   > shutdown.exe /r   
   >   
   > :Shutdown   
   > echo Shutting Down...   
   > shutdown.exe /p   
   >   
   > :Logoff   
   > echo logging Off   
   > shutdown.exe /l   
   >   
   > :Cancel   
   > taskkill /im cmd.exe   
   >   
   > :FAIL   
   > echo Invalid Choice   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca