I am writing some little tools for MS-DOS. Now I'm writing a Shutdown.com
, like for Windows XP and greater. I have already written the entire code, now I just need to pass the argument from DOS.
I need to pass the parameters "-r" to reboot and "-s" to shutdown.
How can I do it?
I'm using TASM(Turbo Assembler 4.1) on Windows 98 to link and compile. I'm looking for a very simple way to do it, and if possible, still a .COM
program. I'm looking exactly like the ARGV and ARGC from C language, but for Assembly 16-bits...
shutdown -r
will rebootshutdown -s
will shutdown
Remember that I already know how to reboot and how to shutdown the PC.
I just need to learn how to pass the parameters from the MS-DOS command line to my program.
shutdown.com
a command line program? That is, to use it from the command line, can you typeshutdown -r
? – Organism.com
files receive parameters in the PSP at offset 80h. That page even has assembly sample code ;) – Pennant