wdfboltonc Posted February 7, 2014 Share Posted February 7, 2014 Hi All, I'm in the process of creating an AutoIT file to run periodically on a local machine and set the local administrator password to a random value. The important part of the script is that it will run in the user context but needs to output the new password to a locked down share that only IT support have access. I'm having issues writing to a file with the standard $file = FileOpen('' & $NetworkLogPath & @ComputerName & '.log', 9) function. I have tried running it with a RunAs function with an account with write permissions to the folder but still unable to create and write to the file. Any pointers would be welcomed. Thanks Craig Link to comment Share on other sites More sharing options...
Gianni Posted February 7, 2014 Share Posted February 7, 2014 (edited) what error do you get? p.s. (not even to ask if your $NetworkLogPath variable ends with a slash "" of course) Edited February 7, 2014 by PincoPanco Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
jdelaney Posted February 7, 2014 Share Posted February 7, 2014 (edited) Could always try to first DriveMapAdd the share, and then do the fileopen (that would get around the runas, since the rights are associated with the drive, and not the user running the script)...plus, DriveMapAdd returns a lot more @error data, for debugging. I agree with PincoPanco, post the definition of those variables as well. Edited February 7, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. 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