How do you start a program stored on a UNC share from the command line with parameters?

There's an in-house program we use and it's stored on a UNC share so that updates are transparent. I'd like to supply it some command line parameters like so:

\\server\share\in_house_thingy.exe myusername mypassword

But I can't seem to get it to work in either CMD or PowerShell or via a shortcut.

Anyone got any ideas?

Answers


For a shortcut, change the target to be like:

"\\server\share\in_house_thingy.exe" myusername mypassword

unless you really do want to have to use powershell to make this work.


You could use:

$app = '\\server\share\in_house_thingy.exe'
$arguments = 'myusername mypassword'
$process = [System.Diagnostics.Process]::Start($app, $arguments)

The $process object will give you a live process object if you want to get an exit code or other information from that process.


Need Your Help

Executing methods from an ASP.NET user control

c# asp.net javascript telerik

I have a user control written in C# in a Telerik ajaxified page. I wrote a context menu using RadContextMenu and everything works fine except one of my menu items is "refresh". How can I refresh my...

Mail gem determine whether plaintext or html

ruby ruby-on-rails-3 email imap

I'm using the mail gem from https://github.com/mikel/mail

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.