Unfortunately, this question is hard to understand. So, sorry if I'm answering a wrong question; please don't blame me too much for that.
It seems to me that your problem is running a child process from your application, such as you would do by the command line like
net use z: %source%
, where
%source%
is some parameter. I also think that you are talking about .NET application — please see my comment to the question.
If this is the problem, the solution is this: you need to use the class
System.Diagnostics::Process::Start
, please see:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx[
^],
http://msdn.microsoft.com/en-us/library/h6ak8zt5.aspx[
^].
If you have a batch file with a parameter (should be represented as
%1
in the code of a batch file), the first parameter of
Process::Start
should be a name of the batch file, and second parameter — the parameter(s) of the batch file.
Also, you may need to redirect the output of the child process to a stream to use the output in your host program. For this purpose, you need to use the properties
StandardOutput
and
StandardError
(just in case there are errors :-)). You can find a code sample for redirection here:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.standardoutput.aspx[
^].
—SA