开发者

system.diagnostic.process.start problem

Im trying to create an application launcher using vb.net. I'm trying 开发者_运维技巧to launch desktop shortcuts that are hidden because I want my desktop to be free of mess. Those shortcuts are created through nircmd :http://www.nirsoft.net/utils/nircmd.html

I used this code: System.Diagnostics.Process.Start("E:\Documents and Settings\Rew\Desktop\SpeakClipboard.exe")

And it returned the error that the path specified cannot be found. I tried launching an application in program files using this method and it worked well. Is there a problem with shortcuts? I cannot specify the path for the file where the shortcut is linked because its a shortcut in the desktop and doesn't point to anything except the nircmd.exe that is on : F:\NIRCMD

But I also tried using this path for system.diagnostic.process.start:

F:\NIRCMD\nircmd.exe cdrom open g:

But still no luck.


If I understand correctly SpeakClipboard.exe is actually a shortcut? If so it probably has a hidden .lnk extension. So you should specify SpeakClipboard.exe.lnk or SpeakClipboard.lnk if it doesn't actually have .exe in the name.


There is a property on the ProcessStartInfo object that allows you to specify an argument.

eg your command would be "F:\NIRCMD\nircmd.exe" and the arguments would be "cdrom open g:"

Does that work?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜