Will,
Basically, you will want to call the static Start method on the Process
class. Create a variable which would be the same as @LaunchImportString and
then pass that to the method.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
(E-Mail Removed)
"Will Asrari" <news[at]willasrari.comNOSPAM> wrote in message
news:%(E-Mail Removed)...
>I am working on a project now for a client that requires all managed code.
>I have rewritten about 60% of the code and functionality in C# and have now
>come to the complicated part of picking apart the existing stored procedure
>and "managing" it. Two tasks that I am outing from the stored procedure
>are as follows:
>
> 1) execution of a .vbs that creates a .txt file (CSV) of user information
> 2) loading of said text file into an .exe and executing via command line
>
> I can achieve the same result as 1 with a streamwriter. This shouldn't be
> too complicated. Number 2 is what I am worried about. The .exe will
> reside on the same server where my application exists. What would be the
> best way to accomplish this task in a managed way?
>
> I tried opening the exe on the server by double-clicking it and got the
> following error:
>
> "%E: Cannot find "\Ent=' parameter on the command line."
>
> So there is no GUI. It seems as if this is a simple console application.
>
> Here is the line from the old stored procedure:
>
> SET @LaunchImportString = '\\' + @AppServer +
> '\applicationName\sys_exe\ga_imp2.exe /GO /Ent=' + cast(@EntID as
> varchar(20)) + ' /Store=1'
> exec master..xp_cmdshell @LaunchImportString, no_output
>
> Since I wasn't the original author of this software I don't know all of
> the code. I do know that I'm not going to use SQL server to access the
> command line.
>
> Thanks in advance,
>
> - Will
>