RunAs localadmin batch file

1 reply [Last post]
TheUltraViolence
TheUltraViolence's picture
Offline
Neophyte
Joined: 2011/01/02

i'm creating an automatic mainteance batch file for my domain. i want my users to be able to execute the batch and run the three simple programs defrag, diskcleaup and chkdsk as the local admin because normal users don't have permissions to run dskchk and defrag.

it's a windows xp domain. so it'd look something like this

cleanmgr
runas /env /user:"localadmin" defrag :c /v /f
runas /env /user:"localadmin" dskchk :c

very simple, but i don't know how to put a universal "local admin" because obviously the admin account is different on different computers, and i know that it won't work is the admin password is blank depending on the comand.

thoughts gentlemen?

even a pawn, can put a king in check.