Windows batch files: .bat vs .cmd?

From this news group posting by Mark Zbikowski himself: The differences between .CMD and .BAT as far as CMD.EXE is concerned are: With extensions enabled, PATH/APPEND/PROMPT/SET/ASSOC in .CMD files will set ERRORLEVEL regardless of error. .BAT sets ERRORLEVEL only on errors. In other words, if ERRORLEVEL is set to non-0 and then you run one … Read more

How do I get the application exit code from a Windows command line?

A pseudo environment variable named errorlevel stores the exit code: echo Exit Code is %errorlevel% Also, the if command has a special syntax: if errorlevel See if /? for details. Example @echo off my_nify_exe.exe if errorlevel 1 ( echo Failure Reason Given is %errorlevel% exit /b %errorlevel% ) Warning: If you set an environment variable … Read more

How to “comment-out” (add comment) in a batch/cmd?

Use :: or REM :: commenttttttttttt REM commenttttttttttt BUT (as people noted): if they are not in the beginning of line, then add & character: your commands here & :: commenttttttttttt Inside nested parts (IF/ELSE, FOR loops, etc…) :: should be followed with normal line, otherwise it gives error (use REM there). :: may also … Read more

How do I kill the process currently using a port on localhost in Windows? [closed]

Step 1: Open up cmd.exe (note: you may need to run it as an administrator, but this isn’t always necessary), then run the below command: netstat -ano | findstr :<PORT> (Replace <PORT> with the port number you want, but keep the colon) The area circled in red shows the PID (process identifier). Locate the PID … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)