HockeyFan Posted January 19, 2011 Share Posted January 19, 2011 Question... Is it possible to open a text file with elevated rights while a script is running as a regular user for editing? I'm using the "FileOpen" command in my script and just discovered that the file I'm attempting to append, the user does not have the "modify" right to. I can not change the location of the file I'm attempting to modify. I tried this, but it is not really working... RunAs("UserName", @ComputerName, "Password", 0, "C:\Windows\system32\notepad.exe C:\SoftwareDir\AppName\FileName.txt", "C:\Windows\system32\") WinWaitActive("FileName.txt - Notepad") Send("This is some added text.") WinClose("FileName- Notepad") WinWaitActive("Notepad", "Do you want to save") Send("!n") fyi...when the original script is running, I don't want the "FileName.txt" file to bee seen by the user or on the task bar. Any ideas? Link to comment Share on other sites More sharing options...
HockeyFan Posted January 27, 2011 Author Share Posted January 27, 2011 Yea!!!! Thanks to other posts referencing "SetACL"...thanks HelgeKlein.com... my issue has been solved; albiet a work around. Bottom line, it works! Oh, and special thanks to those to posted a reply to this thread!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now