Executing Windows CLI Commands in a Batch File.
1. I need to write a batch script file using Notepad++ and name it MyCommand.cmd
2. I then need to write a pseudocode statements for my script. I wrote the script but it doesn't work when I copy and paste it into the CLI. I'm supposed to create a batch script file and save it but I'm not sure of how to retrieve it from the CLI because I'm not sure which command to use to retrieve it so it can run in the CLI.
Here is the script:
cls
@echo off
Rem Jerry Springer
Rem January 2014
echo MyCommands.cmd Script is now running
echo.
netsh interface ip show config NIC
netsh interface ip set address source=static 150.100.10.60 255.255.255.0 150.100.10.1 0
timeout /t 6 > nul
netsh interface ip show config NIC
netsh interface ip set address NIC source=dhcp
timeout /t 6 > nul
netsh interface ip show address config NIC
echo.
shutdown /s /t 60 /c "Local Shutdown in 1 minute!!"
timeout /t 4 > nul
shutdown /a
echo Shutdown has been Aborted
echo.
echo End of Script