DOS .... Command Prompt ..... Batch Files

G

Guest

Hello:



The popular scripting languages are VBscript, ADSI, WMI,WSH, ETC. I am
highly interested in the use of Scripting to (help) manage computer
networks. Here is my question:



* How useful is it to be able to write batch files and run them from the
command prompt to help manage the typical network ? Is DOS-like scripting
and batch files worth the
required investment of time and effort ?

* Take a simple command like CHKDSK.EXE or DEFRAG.EXE. How would you run
these commands across a bunch of machines using (DOS) command prompt or
batch files ?



Thanks,
Jo.
 
J

Jerold Schulman

Hello:



The popular scripting languages are VBscript, ADSI, WMI,WSH, ETC. I am
highly interested in the use of Scripting to (help) manage computer
networks. Here is my question:



* How useful is it to be able to write batch files and run them from the
command prompt to help manage the typical network ? Is DOS-like scripting
and batch files worth the
required investment of time and effort ?

* Take a simple command like CHKDSK.EXE or DEFRAG.EXE. How would you run
these commands across a bunch of machines using (DOS) command prompt or
batch files ?



Thanks,
Jo.
Sometimes the CMD processor is the best tool for a job.
Generally, a mix of tools is the correct choice.

To run a job remotely, use PsExec.exe, tip 4141 » PsExec freeware executes programs remotely.
in the 'Tips & Tricks' at http://www.jsifaq.com

To run defrag.exe on all Windows XP clients C: drive:

@echo off
setlocal
set qry=reg.exe query
for /f "Tokens=1" %%c in ('net view /domain:"%USERDOMAIN%"^|Findstr /L /C:"\\"') do (
for /f "Tokens=2*" %%r in ('%qry% "%%c\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentVersion^|find "REG_SZ"') do (
if "%%s" EQU "5.1" @echo %%c&psexec %%c -u domadminaccount -p domadminpwd defrag C: -f
)
)
endlocal
 
A

Al Dunbar [MS-MVP]

Hello:



The popular scripting languages are VBscript, ADSI, WMI,WSH, ETC.

VBScript is a scripting language, but the other three are not. ADSI and WMI
refer to sets of COM objects that can be used in scripts written in a
variety of languages and in different script host contexts. WSH is one
particular script host environment that supports scripting languages
VBScript, JScript, and some others.
I am
highly interested in the use of Scripting to (help) manage computer
networks. Here is my question:



* How useful is it to be able to write batch files and run them from the
command prompt to help manage the typical network ? Is DOS-like scripting
and batch files worth the
required investment of time and effort ?

That would depend on the return you would get from that investment, which
might be different from what others would get. IMHO, however, one cannot
possibly be considered to be managing a network while remaining unaware of
the various administrative things that can be done with batch scripts.

That said, what some of us do in batch, others will do in VBScript because
we all have different levels of experience, competence, and comfort in these
tools.


/Al
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top