E
EJS
We are using Network Associates VirusScan to check files uploaded from a web
page for viruses.
The code below worked fine using .Net 1.1 on Win2000. The ASP.Net user
account was given permissions to run the EXE and access to the files being
scanned.
When we migrated to Win2003 we ran into problems. ASP.Net now runs under the
Network Services account. So we gave this account the same privilages but
the code throws an System.ComponentModel.Win32Exception "Access is Denied"
If we add the Network Services account to the "Administrators" group the
code executes WITHOUT error.
Any help would be greatly appreciated
Thanks in advance.
Ed
CODE:
//Run Virus Scan
oCmd = Process.Start(sScanExe, sFilePath); <---- ERROR
//Wait for iScanTimeOut mSec
//If OS exited the procees true is returned if timed out false is returned
bNormalExit = oCmd.WaitForExit(iScanTimeOut);
iErrorCode = oCmd.ExitCode;
oCmd.Close();
Error Log:
; Source: System
; Description: Access is denied
; Stack: at
System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo
startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(String fileName, String arguments)
page for viruses.
The code below worked fine using .Net 1.1 on Win2000. The ASP.Net user
account was given permissions to run the EXE and access to the files being
scanned.
When we migrated to Win2003 we ran into problems. ASP.Net now runs under the
Network Services account. So we gave this account the same privilages but
the code throws an System.ComponentModel.Win32Exception "Access is Denied"
If we add the Network Services account to the "Administrators" group the
code executes WITHOUT error.
Any help would be greatly appreciated
Thanks in advance.
Ed
CODE:
//Run Virus Scan
oCmd = Process.Start(sScanExe, sFilePath); <---- ERROR
//Wait for iScanTimeOut mSec
//If OS exited the procees true is returned if timed out false is returned
bNormalExit = oCmd.WaitForExit(iScanTimeOut);
iErrorCode = oCmd.ExitCode;
oCmd.Close();
Error Log:
; Source: System
; Description: Access is denied
; Stack: at
System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo
startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(String fileName, String arguments)