Access denied.

krsh24

Active member
Joined
Sep 16, 2006
Messages
25
Programming Experience
3-5
Hi

I have to start a vc++ application from vb.net application. I have implemented it and the code snippet is

VB.NET:
 With startInfo
                    .FileName = sPath
                    .Arguments = sCmdParams.Trim
                    .UseShellExecute = True
                    .RedirectStandardOutput = False
                    .WindowStyle = ProcessWindowStyle.Normal
 End With

 oProcess = System.Diagnostics.Process.Start(startInfo)

but when i call the start method some times i get "access is denied". can any one explain me under wat circumstances this error can occur.

Thanks in advance
 
Last edited by a moderator:
If your application throws the Win32Exception with this message on this call to Process.Start it probably means user don't have permission for the file or folder. If it's the other application it could mean just about anything, but usually a permission issue of some sort.
 
Since WorkingDirectory here is empty and UseShellExecute is true, it means WorkingDirectory specifies where the executable is. In case current directory was changed and only relative path was specified for the executable I thought this would result in a "File not found"?
 
Back
Top