473,466 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

System.Diagnostics.Process support for calling vbs file

Hi all,
I am tring to call a .vbs file using System.Diagnostics.Process class with
following code.

Process objProcess = new Process();
objProcess.StartInfo.FileName = "C:\\testScript.vbs";
objProcess.StartInfo.Arguments ="1 2 test2.txt";
objProcess.Start();
objProcess.WaitForExit();

It is blowing up on executing the code,
althought the vbs script file is working fine on running indivually.

Any help is appriciated.

Thanks and Looking Forward,
Rupali
Mar 8 '06 #1
2 2955
What do you mean by "blowing up" ?

My first thought would be something related to security (is this the same
security context ? anti-virus software ? etc...)

--
Patrice

"Rupali" <Ru****@discussions.microsoft.com> a écrit dans le message de
news:37**********************************@microsof t.com...
Hi all,
I am tring to call a .vbs file using System.Diagnostics.Process class with
following code.

Process objProcess = new Process();
objProcess.StartInfo.FileName = "C:\\testScript.vbs";
objProcess.StartInfo.Arguments ="1 2 test2.txt";
objProcess.Start();
objProcess.WaitForExit();

It is blowing up on executing the code,
althought the vbs script file is working fine on running indivually.

Any help is appriciated.

Thanks and Looking Forward,
Rupali

Mar 8 '06 #2
Works fine from here. What problem or error are you getting?

Dim obj_process As New System.Diagnostics.Process
With obj_process
.StartInfo.FileName = "C:\\testScript.vbs"
.StartInfo.Arguments = "1 2 test2.txt"
.Start()
.WaitForExit()
End With

------------ testScript.vbs --------------
msgBox "TEST"

Bryan Martin
sp**@myplaceinspace.com

"Rupali" <Ru****@discussions.microsoft.com> wrote in message
news:37**********************************@microsof t.com...
Hi all,
I am tring to call a .vbs file using System.Diagnostics.Process class with
following code.

Process objProcess = new Process();
objProcess.StartInfo.FileName = "C:\\testScript.vbs";
objProcess.StartInfo.Arguments ="1 2 test2.txt";
objProcess.Start();
objProcess.WaitForExit();

It is blowing up on executing the code,
althought the vbs script file is working fine on running indivually.

Any help is appriciated.

Thanks and Looking Forward,
Rupali

Mar 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: danl | last post by:
I need to be able to execute a .bat file from a C# web application I have the following code that compliles and seems to run fine, but the bat file never does it's work...
3
by: danl | last post by:
I need to be able to execute a .bat file from a C# web application I have the following code that compliles and seems to run fine, but the bat file never does it's work...
9
by: danl | last post by:
I need to be able to execute a .bat file from a C# web application I have the following code that compliles and seems to run fine, but the bat file never does it's work...
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.