I use...
Mainly:
http://ss64.com/nt/ (also click Syntax at the top, the first set of links being the most important)
Google for various questions/info,
MSDN:
Command Prompt:
http://msdn.microsoft.com/en-us/library/bb490890.aspxGetting more technical on the command line with VBScript and its resources (damn 2 url limit!):
VBScript: msdn.microsoft.com/en-us/library/d1wf56tt%28v=vs.85%29.aspx
Wscript: msdn.microsoft.com/en-us/library/at5ydy31%28v=vs.85%29.aspx
(kind of a must-know for vbscript, run vbscripts on the command line through cscript.exe)
WMI: msdn.microsoft.com/en-us/library/aa394572%28v=vs.85%29.aspx
(used best via vbscript, but command line's WMIC.exe works too)
The totally awesome must-have Scriptomatic for WMI:
microsoft.com/downloads/en/details.aspx?FamilyID=09dfc342-648b-4119-b7eb-783b0f7d1178
WsShell: msdn.microsoft.com/en-us/library/aew9yb99%28v=vs.85%29.aspx
(this windows object can do some particular/cool stuff)
As for being stumped, I think this place is the best to ask a question. A handful of experienced people like me do research here, so it has a lot of info on the deepest technicalities.
Once you know the ins and outs of DOS, VBScript takes some thought, but it's actually not so daunting. I started learning it not a week ago and I've made some great tools. Heck I'll share a few:
tools.vbsCommand lines:
cscript tools.vbs //nologo sleep secondsSelf-explanatory. Better than using the ping trick to create delays.
cscript tools.vbs //nologo calc expressionCalculates 16-digit numbers. Dunno why, but it's better than DOS's 32-bit limitation, short of splitting it.
cscript tools.vbs //nologo tasks (megabytes)Lists running processes (excluding explorer.exe and svchost.exe) in the format:
___.exe*memory usage in megabytes*command line
Setting the megabytes argument will show only processes using more than the value. It is optional.
I like it better than tasklist. Should work on XP Home too, where tasklist is nonexistent.
Notes:
-Rounds memory usage of each process to the nearest megabyte.
-Removes all quotation marks from the command line property, for DOS's sake.
Code: Select all
select case wscript.arguments(0)
case "sleep"
wscript.sleep wscript.arguments(1)*1000
case "calc"
wscript.echo eval(wscript.arguments(1))
case "tasks"
if wscript.arguments.count=2 then a=wscript.arguments(1) else a=0
set b=getobject("winmgmts:")
set c=b.execquery("select name,workingsetsize,commandline from win32_process")
for each d in c
if d.name<>"System Idle Process" and d.name<>"System" and d.name<>"svchost.exe" and d.name<>"explorer.exe" then
e=round(d.workingsetsize/1000000)
if not isnull(d.commandline) then f=replace(d.commandline,"""","") else f=null
if e>cint(a) then g=g&d.name&"*"&e&"*"&f&vblf
end if
next
wscript.echo g
end select
Like the above, using WMI is as easy as:
Code: Select all
set a=getobject("winmgmts:")
set b=a.execquery("select whatever_property from win32_whatever_resource")
for each c in b
wscript.echo c.whatever_property
next