Search the Community
Showing results for tags 'runas;'.
Found 1 result
FileCopy not working when using runas
Roshith posted a topic in AutoIt General Help and SupportHi, I have written a scan utility that scans for certain items on the machine and upload the report to shared path The utility consists of 2 exe files 1) 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 path When 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.exe But when I run Fileuploader by double clicking on Fileuploader.exe, the file is copied to the shared path Attached are the codes for both exe files Any tips would be of great help Thanks in advance Roshith ; ; ; ;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)