(imported topic written by BuzzBourque)
OS: Windows 7 (x64 and x86)
What is the recommended method for running certain Windows commands that require “run as administrator”? For example, say I wanted to run a command to create a directory under c:\windows\system32 by using the following command…
waithidden cmd /c “MD C:\Windows\System32\testdir”
…the task would complete sucessfully but the directory would not be created.
More examples…
//Prepare drive for Bitlocker
waithidden cmd /c “BdeHdCfg -target c: shrink -newdriveletter s: -size 300 -quiet -restart”
//Rename computer
waithidden cmd /c “WMIC ComputerSystem where Name=”%computername%" call Rename Name=newname"
…I’ve tried different methods of running these commands; creatfile, appendfile, run, wait, dos, etc. with no success.
any help would be appreciated.