Running Process.Start Inside Microsoft Virtual Server

G

Guest

I have an Exchange Server 2000 installed as a Vitual Server in my test lab.
I am creating an application that does a variety of functions and then runs
Exmerge to create PST's for certain users.

I create a new process, specify the path and exe to run, in the case some
path followed by Exmerge.exe. When the process starts I get "Win32
Exception: System Cannot Find File Specified"

I tried to reference the path & file directly, C:\program
files\exchsrvr\bin\exmerge.exe, c:\progra~1\exchsrvr\bin\exmerger.exe and
\\win2k-exchange\c$\program files etc.... All of which return the same
result. As a test I copied the Notepad.exe file into the same path as
exmerge.exe and then adjust my Process.Start() and it runs Notepad correctly?
But notepad isn't the best test of Process.Start()

Basically, here is my code (VB.NET)

Dim p as Process
Dim s as ProcessStartInfo

s.FileName = "exmerge.exe"
s.Arguments = "-B -D -F " & currWork & "\schema.ini"
s.WorkingDirectory = cfg.Exmerge_execution_path 'References Directory Where
Exmerge is stored.

p = new Process()
p.Start(s) 'Exception Thrown Here

The path shows up correctly because I've kicked it out to a log file to see
myself. I also ran it without arguments. I also tried just creating the
Process object and supplying parameters in the constructor to no avail.

I apologize this is such a long post but I'm stuck.
 
G

Guest

Jeremy,
I think the FileName parameter should contain the full path. The Working
directory is what the processes working dir will be once launched.

e.g.
s.FileName = cfg.Exmerge_execution_path & "\exmerge.exe"

Regards
Niroo [MSFT]
 
G

Guest

Nirro,

I do believe I tried that but no with the ProcessStartInfo object. I had
originally been doing the following:

p.start(cfg.Exmerge_Execution_Path & "\exmerge.exe") and was receiving the
same error. I will try what you suggested to see if that works.

Thank you for the idea.
 
R

ray.bradbury9

Dim p as Process
Dim s as ProcessStartInfo

s.FileName = "exmerge.exe"
s.Arguments = "-B -D -F " & currWork & "\schema.ini"
s.WorkingDirectory = cfg.Exmerge_execution_path 'References Directory Where
Exmerge is stored.

p = new Process()
p.Start(s) 'Exception Thrown Here

s.FileName = cfg.Exmerge_execution_path & "exmerge.exe"
s.arguments = "-B -D -F schema.ini"
s.WorkingDirectory = The directory where schema.ini resides (can be
different to exmerge's directory)

The filename, as Niroo TP said, must have the full path. The working
directory is usefull to let the process find the filenames passed as
arguments (is the directory in with the process will be executed and
will look for the files).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top