473,396 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Diagnostics process - dos command

The following process won't work if I use "move" in the FileName. However, if I replace it with @"c:\winnt\system32\xcopy.exe ", then it works fine. Is there anything I missed. It is running on Windows 2000 server (not Advanced Server)

Process d
d = new Process()
d.EnableRaisingEvents = false
d.StartInfo.FileName = "move"
d.StartInfo.Arguments = @"c:\*.jpg c:\image\"
d.Start()
d.Close()
d.Dispose();
Nov 15 '05 #1
3 1358
Try setting UseShellExecute (?) to true.
-mike
MVP

"RSAGS" <an*******@discussions.microsoft.com> wrote in message
news:93**********************************@microsof t.com...
The following process won't work if I use "move" in the FileName. However, if I replace it with @"c:\winnt\system32\xcopy.exe ", then it works
fine. Is there anything I missed. It is running on Windows 2000 server
(not Advanced Server).
Process d;
d = new Process();
d.EnableRaisingEvents = false;
d.StartInfo.FileName = "move";
d.StartInfo.Arguments = @"c:\*.jpg c:\image\" ;
d.Start();
d.Close();
d.Dispose();

Nov 15 '05 #2
RSAGS,

I believe that move is something that is interpreted by the command
line, not an actual process. So, to get it to work, your executable would
have to be CMD.EXE and then pass "MOVE" as the first parameter.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"RSAGS" <an*******@discussions.microsoft.com> wrote in message
news:93**********************************@microsof t.com...
The following process won't work if I use "move" in the FileName. However, if I replace it with @"c:\winnt\system32\xcopy.exe ", then it works
fine. Is there anything I missed. It is running on Windows 2000 server
(not Advanced Server).
Process d;
d = new Process();
d.EnableRaisingEvents = false;
d.StartInfo.FileName = "move";
d.StartInfo.Arguments = @"c:\*.jpg c:\image\" ;
d.Start();
d.Close();
d.Dispose();

Nov 15 '05 #3
Nicholas it works great. Thank
Michael thanks.
Nov 15 '05 #4

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

Similar topics

0
by: Daniel Reber | last post by:
I am trying to start a process from a windows service but when the process starts the command window that the process runs in never shows. Is this because I am calling it from a windows service? ...
2
by: Joey Mack | last post by:
Greetings. I am trying to use the System.Diagnostics.Process class to perform some actions through the Windows command line. The applicable code appears below. The code builds the follow command...
2
by: Eranga | last post by:
I have a windows application in C# which has the following method public void InitiateSession(string server,string userName, string passWd ) { //To start the command...
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...
5
by: Ty Moffett | last post by:
I'm using a queue to hold a series of strings that are complete command line arguments to start the silent/unattended installation of various pieces of software. Here is some sample code. 1 Dim...
11
by: Nurit N | last post by:
This is the third newsgroup that I'm posting my problem. I'm sorry for the multiple posts but the matter becoming urgent. I hope this is the right place for it... I have created a very...
1
by: Brad | last post by:
I have an issue trying to execute commands in a web service. The command starts under the specified user. However, it never completes its execution. I can execute simple commands like "echo HELLO"...
0
by: Daniel | last post by:
C# windows service freezes on System.Diagnostics.Process.Start(info) When I launch PSCP from a C# windows service and launch pscp 0.53 there are no issues. but when I use C# windows service to...
11
by: Jon Davis | last post by:
Does anyone know why using System.Diagnostics.Process to "wrap" a console application does not always transmit the I/O, depending on what processes you're trying to "consume"? PowerShell, for...
2
by: test3 | last post by:
Hello folks, I'm using System.Diagnostics.Process to start a thirdparty program (that works perfectly when started via command line). I'm using Process.StandardOutput to get the output of the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
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,...

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.