![]() |
|
|
|||||||
| Petri.co.il is happy to award auglan the title of Most Valuable Member !!! |
| Register | Calendar |
Search |
Today's Posts |
Mark Forums Read |
| Notices |
|
|
Script to change permissions on a System32 filethis thread has 7 replies and has been viewed 8926 times
|
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||||||||
|
||||||||||
|
I need to change the permission on a driver file located in C:\Windows\System32 folder. If the file is called Mouse.drv and the User Group has Read & Execute plus Read permissions, is it possible to create a script to change the permissions to Write or possible Modify? This script needs to be able to run from a standard login.bat script or from an external script using the CALL function.
This needs to be done on several hundred PCs so they can run some old educational program that was originally designed for Windows 3.1. My feeble attemps so far have been shall we say......feeble.
__________________
"There I stood at the bar, wearing a Mae West, no jacket, and beginning to leak blood from my torn boot. None of the golfers took any notice of me - after all, I wasn't a member!" Kenneth Lee - after being shot down during the Battle of Britain on the 18th August 1940. ************************************************** ********************** ** Remember to give credit where credit is due and leave reputation points where appropriate ** ************************************************** ********************** |
|
#2
|
|||||||||
|
|||||||||
|
Use Microsoft's Xcacls.vbs
download and take a look at the examples at: How to use Xcacls.vbs to modify NTFS permissions you can place the Xcacls.vbs at the NTELOGON folder, and call it from your login.bat script: Code:
cscript %0\..\Xcacls.vbs C:\Windows\System32\Mouse.drv /G EVERYONE:f To "append" the permissions check the /P option, but note that /P behaves like /G if there are no rights set for EVERYONE. good luck, Martin77. |
|
#3
|
||||||||||
|
||||||||||
|
Can you not set a startup script and then use xcacls?
__________________
Server 2000 MCP Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com ** Remember to give credit where credit is due and leave reputation points |
|
#4
|
|||||||||
|
|||||||||
|
Not sure I understood the question.
You can even run the Xcacls.vbs from your workstation against a different machine: Code:
Xcacls.vbs \\SOMEPC\C$\Windows\System32\Mouse.drv /G EVERYONE:f |
|
#5
|
||||||||||
|
||||||||||
|
summarised:
Quote:
http://support.microsoft.com/kb/135268 - Xcacls.exe support the use of the /Y switch and it replaces Cacls.exe - Xcacls.vbs replaces xCacls.exe http://www.jsifaq.com/SF/Tips/Tip.aspx?id=8225 You can link the xcacls.vbs as a start-up script in a GPO linked to the client computers OU. There, in the script parameters box you can also enter the parameters for the commandline (so you dont have to create a separate script for these switches) Or, if you planned to run it against remote computers. Code:
For /f %%a in (c:\computerlist.txt) Do cscript //B //NoLogo "\\server\share\XCACLS.vbs" "c:\Windows\system32\test.txt" /E /G "Authenticated Users":F /SERVER %%a /Q optionaly, you can also use the /User and /Pass switches to use alternate credentials (by default the script will use your credentials to connect to the remote computers). http://support.microsoft.com/kb/825751 \Rems Last edited by Rems; 18th September 2007 at 14:57.. |
|
#6
|
||||||||||
|
||||||||||
|
Thanks guys, I appreciate the help. I just wanted this to be as easy as possible so when I leave this site the next moron doesn't have the same problems with the ancient software that I have had. Guess it ain't going to be as simple as I wanted.
Points for everyone because I am getting too old to learn this shit properly and can only watch in awe at the scripting skills you have (I am annoyed I had forgotten about Xcalcs though).
__________________
"There I stood at the bar, wearing a Mae West, no jacket, and beginning to leak blood from my torn boot. None of the golfers took any notice of me - after all, I wasn't a member!" Kenneth Lee - after being shot down during the Battle of Britain on the 18th August 1940. ************************************************** ********************** ** Remember to give credit where credit is due and leave reputation points where appropriate ** ************************************************** ********************** |
|
#7
|
|||||||||||
|
|||||||||||
|
Old age will do that to you
Soon you'll forget that you owe me £1000 - Actually, it might have happened already Michael
__________________
Michael Armstrong www.m80arm.co.uk MCITP: EA, MCTS, MCSE 2003, MCSA 2003: Messaging, CCA, VCP 3.5, 4, 5, VCAP5-DCD, VCAP5-DCA, ITIL, MCP, PGP Certified Technician ** Remember to give credit where credit is due and leave reputation points |
|
#8
|
||||||||||
|
||||||||||
|
Quote:
__________________
"There I stood at the bar, wearing a Mae West, no jacket, and beginning to leak blood from my torn boot. None of the golfers took any notice of me - after all, I wasn't a member!" Kenneth Lee - after being shot down during the Battle of Britain on the 18th August 1940. ************************************************** ********************** ** Remember to give credit where credit is due and leave reputation points where appropriate ** ************************************************** ********************** |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| change file name to date with script | poly | General Scripting | 6 | 3rd September 2007 17:34 |
| put a file in %windir%\system32 | wolfgang | General Scripting | 2 | 27th April 2007 18:33 |
| Reassigning permissions on File server via script | jessshouse | General Scripting | 5 | 16th November 2006 22:16 |
| Permissions on %systemroot%\system32\GroupPolicy | jachin84 | GPO | 2 | 16th January 2006 10:25 |
| Script to change Diretory and File Permissions | dlucas10 | General Scripting | 1 | 17th November 2005 08:32 |