I would like to create a windows notepad script command that when run from a program would send a command to the arduino to say turn on pin 13 and hold that state. Then have another script run that would send a command to the arduino to tun off pin 13. What arduino code and what script code would I use for this.
If you look through the examples in the Arduino IDE, you'll see examples of using serial commands.
If you can turn the LED on and off by issuing commands in the serial terminal, you'll be close to have code to receive commands from a computer program. The computer program would send the same sort of characters as you sent with the terminal program.
You could use simple batch files, but you would need to use a resistor or capacitor to defeat the arduino auto reset feature.
I would write a short Python program to send the data to the Arduino. The Python program can be called from the command line. (Or use your favourite programming language).
This Python - Arduino demo may give you some ideas. This Thread Serial Input Basics was written more recently and illustrates simple reliable ways for an Arduino to receive data. If possible get your PC program to work with the 3rd example for greatest reliability.
...R
Test batch files I've used to send servo commands to an ssc-32 servo controller.
::@echo off
mode com3:9600,N,8,1 >nul
echo #0P2200 >com3
ping -n 2 127.0.0.1 >nul
echo #0P1500 t3000 >com3
ping -n 5 127.0.0.1 >nul
echo #0P2200 >com3
ping -n 2 127.0.0.1 >nul
echo #0P1500 t3000 >com3
ping -n 5 127.0.0.1 >nul
echo #0P2200 >com3
ping -n 2 127.0.0.1 >nul
exit
servoloop.bat
::@echo off
::mode com3:9600,N,8,1 >nul
echo moving servos
echo 07001500 > com3
echo 8 second delay
ping -n 9 127.0.0.1 >nul
echo 22000700 > com3
echo 5 second delay
ping -n 6 127.0.0.1 >nul
echo 15001500 > com3
echo 5 second delay
ping -n 6 127.0.0.1 >nul
echo 09001800 > com3
echo done
echo Did it work?
echo press any key to restart loop
pause
servoloop.bat