1. you can use longer filenames
2. you can use directory stacks (PUSHD/POPD)
3. better use of arithmetic and integers
4. and alot more command that i don't feel like getting into, i can fill a whole page with reasons to use .cmd instead of .bat.
the only drawback is that .cmd's wont run on really old systems.
TL;DR: NOBODY uses the command.com anymore, get good habits and use cmd.exe
Ohhh, and lastly, stop using notepad, it sucks. Get a real editor, i use SciTE, it has syntax for a ton of programming languages. another good editor is notepad++.
Remove these ads by
Signing UpStep 1Parameters
@echo off
echo the first parameter is %1
echo the second parameter is %2
echo and the third parameter is %3
pause
ok save it as whatever.cmd
i suggest that you make a folder C:\\batch, and save all your batches there, just so they are easier to find.
open up the command prompt, type commands:
CD C://batch (or where ever you saved it)
whatever.cmd a b c
you should get:
the first parameter is a
the second parameter is b
and the third parameter is c
press any button to continue...
and thats all! now, you can type whatever.cmd wut now bitch
and you will get:
the first parameter is wut
the second parameter is now
the second parameter is bitch
press any button to continue...
catch my drift?
| « Previous Step | Download PDFView All Steps | Next Step » |







































What are those temp files you're supposed to delete every week or so?
L
del *.tmp will get rid of them If only i can do this to cookies...
Also its just for deleting them in C:/windows/temp (not on all systems, sometimes its hidden in the userfolder ^-^)
L
P.S.
I really want to see your whole page with reasons to use .cmd instead of .bat!
Windows has not any command.com since win2k...
but I see you're using Vista...Never mind, I see you're using 7.
Also as lemonie said, I love your intro!
I tried to play around with the inegers but it doesn't work better!? I also can use longer filenames and pushd/popd. If you got command.com installed (on win2k and up), that would be stupid. .cmd AND .bat USE THE SAME PROGRAMM: CMD.exe. Thats probably stupid what you are writing...
Nice instructions. I was looking for something to delete files from /windows/temp that have not been in use for more than 30 days. I ended up writing this script in biterscripting.
# Script DeleteTemp.txt
var str list, file
lf -r -n "*" "/windows/temp" ($fatime < addtime(diff("-30000000"))) > $list
while ($list <> "")
do
lex "1" $list > $file
system delete ("\""+$file+"\"")
done
Feel free to use this script. In case you want to change it, the documentation for lf, addtime, etc. are at http://www.biterscripting.com .