Jump to content

Recommended Posts

Posted (edited)

Hi,

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)
Edited by Roshith
Posted (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 by Roshith
Posted

I can manually copy the file to the shared path under "username" credentials..

are there any possibilities the server restricts interaction of tools/utilities?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...