Hi,
I am trying to create a batch file for vista that uses some commands that need to be ran from the "administrative" command prompt. Does anyone know how to do this?
Thanks
Dan
We encourage you to register on our forums and post any questions you might have. The How-To Geeks monitor this forum and will respond to your question quickly.
Lighthouse,
Let me clarify, I know how to create a batch file the problem is I want to run the cacls command in the batch to take permission of a file before the xcopy command that I really want to run. In order to do this I need to have the command prompt running the cacls command be in the administrative mode. By default it opens in the locked down mode in vista.
Dan
I mean when you "right click on the batch file and select run as Administrator" do you get a prompt to elevate?
Also having cmd.exe always run as Administrator would be a security risk as then any process could just the command "cmd.exe badstuff.bat" and it would run elevated.
Okay,
So I was not paying attention properly. When I run the batch file as administrator it goes to the Administrator command prompt. Now my issue is that the command is showing in the command prompt window above the "microsoft windows version .....". does this mean that the command is being run before the command prompt is all the way started? I think this is why I thought the batch file was not working.
Thank you for all your help you guys.
Dan
no, no reason at all. The text of the working batch file is:
Rem You need to run this batch file as administrator or else the icacls command will not work in vista
icacls c:\users\setup\appdata\roaming\microsoft\templates /grant everyone:(F)
xcopy c:\users\%username%\appdata\roaming\microsoft\templates\wfx*.* c:\users\setup\appdata\roaming\microsoft\templates
Do you have any suggestions?
The logged in user is a domain user and the setup folder came from when I setup the machine initially. it is a local user. I had to make the local user generic because I syspreped and used imagex to deploy the image across multiple PC's. for some reason I have to take over rights to the folder first.... stupid vista security!
You must log in to post.
|
svchost.exe jusched.exe dwm.exe ctfmon.exe wmpnetwk.exe |
wmpnscfg.exe rundll32.exe wfcrun32.exe Ipoint.exe Itype.exe |
Wfica32.exe Mobsync.exe Cmd.exe Dpupdchk.exe |