The Sysadmin Notebook  

Sitemap

Automating XP

Automating Tasks on Windows XP

Contents

Task Scheduler

Top Bottom

shtasks: command line interface: only available to administrators

schtasks

Several behind the scenes optimisations rely on Task Scheduler to improve disk layout, boot time and application launch time.

Offline Web Pages are synchronised when you choose synchronise from the Tools menu. Can also be scheduled. Edit an existing schedule to get more detailed control.

Batch Commands

Top Bottom
Batch Commands
Command Explanation
@ prevents the line being displayed
Echo [Off|On]
Echo msg
Echo. displays blank line
REM msg
:: msg non-echoed comment
If not Errorlevel num cmd num or greater
if not exist file cmd
if not txt1 == txt2 cmd
goto label
:label
for %%var in (set)do [cmd] %%var
shift %2 becomes %1
call batfile args
setlocal makes env vars local
endlocal
pushd path saves current folder to stack and changes to path
popd
pause suspends until key is pressed
title set title
%appdata%
%commonprogramfiles%
%comspec%
%homedrive%
%homepath%
%OS%
%path%
%programfiles%
%systemdrive%
%systemroot% %
temp%
%userdomain%
%username%
%userprofile%
%windir%
env vars
>nul send output to bit bucket
for %%t in (wav log ini) do del "%userprofiles%\recent\*.%%t.lnk"

Windows Script Host

Top Bottom

Windows Script Host: a host for scripting languages. Run with the help of a language interpreter (e.g. vbscript.dll or jscript.dll). WSH makes ActiveX controls available to scripts.

wscript: gui

cscript: command line

try 'cscript //?'