Windows doesn't have a shebang/hashbang line like *nix does. This generally constrains the types of scripts that can be run from DS console or Task Management. Much as all of us Python users would like to do something like...
#!C:\python26\python.exe import time print "Hello world" time.sleep(10)
... it just doesn't work because Windows isn't smart enough to pass it on to Python.
A workaround that I have kludged together is to paste the following lines into the top of the script:
rem -- This header cuts itself off ----- set fn=%temp%\%random%.py copy %0 %fn% echo 1,7de | edlin %fn% C:\python26\python -u %fn% exit rem --- Do not edit above this line --
So that the finished product looks like this:
Click to view.
The script is comprised of DOS batch file commands so it should work on any Windows box. It does the following:
This works without any additional components needing to be installed on the target box - besides the Python interpreter of course.
Perl (or your language of choice) should work similarly.
i understand the tip but it doesn't work for me with perl