I'm not too keen on this new over the top 'run as administrator' thing in vista. I know it's for my own protection, to prevent malicious code from altering my system, but it makes batch programming a pain. I'm trying to write a couple scripts, one that will kill windows aero, and one that will start windows aero. The one that starts it works fine, here it is:
@echo off
REM ************** KILL AERO ***********
taskkill /IM Dwm.exe
echo DWM Closing main memory
timeout /T 2 /nobreak
taskkill /IM Dwm.exe
echo DWM Closed
pause
(i'm not too sure why DWM needs to be closed twice, but it does...lol)
this works no problem, kills the 33 MB memory hog like a charm
its the script that closes it that is required to be run as an administrator. most executables (.exe's and .com's) have an option in their properties to always be run as an admin, but for batch files this is grayed out for some reason. is there any way, using perhaps batch commands, to set the status to administrator while in the program? I'm not looking for a better way to get rid of aero, I know there's a few other ways. I guess it just boils down to me being too lazy to right click the batch file and choose run as admin. but i'm thinking there could be much more important uses for this knowledge, such as running scripts on startup that you don't get a chance to run as admin.
here's the code to start aero, if anyone wants to steal it go hard.
@echo off
echo Starting Aero
c:\windows\system32\dwm.exe
timeout /T 2 /nobreak
net stop "uxsms"
net start "uxsms"
echo Aero Running
pause
i know there's a runas command - but i'm not sure of its use or practicality to this situation, it seems like more of a public comp or network command than a admin status command. but i could be wrong, please help!