使用C#.net代码打开CommandPromt [英] Open CommandPromt using C#.net code
问题描述
我能够使用process.start("CMD.exe",strvariable)打开命令提示符.
通过此操作,我可以打开运行我的应用程序的路径.
但是我需要其他一些不同的路径.
有谁能帮助我,我该如何给出我的愿望路径和应该执行的命令,并让我知道部署后它是否有效.
有人请帮助我,
[edit]紧急情况已删除:这可能对您来说很紧急,对我们而言并非如此.您将要做的只是使人烦恼(通过否决票证-有所补偿),并放慢您可能收到的任何响应-OriginalGriff [/edit]
I am able to open command prompt using process.start("CMD.exe", strvariable).
Through this i could open the path where my application is running.
But i need some other different path.
can any one please help me, how can i give my desire path and a command that it should execute and let me know if it works when deployed.
some one please help me,
[edit]Urgency removed: it may be urgent for you, it isn''t for us. All you will do is annoy people (as evidenced by the down vote - compensated a bit) and slow down any response you might have got - OriginalGriff[/edit]
推荐答案
如果您仔细观察Process
类,则会发现ProcessStartInfo.WorkingDirectory
属性.
MSDN [ ProcessStartInfo.WorkingDirectory属性 [ ^ ]
您可以通过一个简单的Google找到它...
[edit]错别字-OriginalGriff [/edit]
If you look a bit closer at theProcess
class, you will find theProcessStartInfo.WorkingDirectory
property.
MSDN[^] has details on the ProcessStartInfo class, and also the ProcessStartInfo.WorkingDirectory property[^]
You could have found this with a simple google...
[edit]Typos - OriginalGriff[/edit]
这篇关于使用C#.net代码打开CommandPromt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!