Roshith Posted April 25, 2012 Share Posted April 25, 2012 (edited) Hi,I have written a scan utility that scans for certain items on the machine and upload the report to shared pathThe utility consists of 2 exe files1) Scanner.exe: Scanner.exe will be running under local admin credentials. This exe does the following functions 1)Scans the machine 2)Write the report in 'C:report.txt' 3)Executes fileuploader.exe with runas function (using credentials which have access to shared path)2) Fileuploader.exe: Copy 'C:report.txt' to shared pathWhen I execute scanner.exe, the report gets generated, but not getting copied to the shared path.The same happens when I manually do a runas for Fileuploader.exeBut when I run Fileuploader by double clicking on Fileuploader.exe, the file is copied to the shared pathAttached are the codes for both exe filesAny tips would be of great helpThanks in advanceRoshith; ; ; ;Code for Scan $sReport = "Scan is completed" $hFile = FileOpen("C:" & @ComputerName & ".txt", 2) FileWriteLine($hFile, $sReport) FileClose($hFile) FileInstall(".FileUploader.exe", @TempDir & "FileUploader.exe", 1) RunAs("username", "domain", "password", 0, @TempDir & "FileUploader.exe", @SystemDir, @SW_HIDE)FileCopy("C:" & @ComputerName & ".txt", "ServerDir1Dir2", 1) Edited April 25, 2012 by Roshith Link to comment Share on other sites More sharing options...
JohnOne Posted April 25, 2012 Share Posted April 25, 2012 Maybe "username" has rights to the shared path but not admin rights to access files on the root of c drive. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Roshith Posted April 25, 2012 Author Share Posted April 25, 2012 (edited) I just re-confirmed. "username" is a domain admin account and have access to the file on local drive and also have read/write access to the shared path Edited April 25, 2012 by Roshith Link to comment Share on other sites More sharing options...
Roshith Posted April 26, 2012 Author Share Posted April 26, 2012 I can manually copy the file to the shared path under "username" credentials.. are there any possibilities the server restricts interaction of tools/utilities? 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