473,396 Members | 2,036 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.

Putting a command line argument in a program shortcut

If I add "string[] args" to the Program.cs file so that there can be
arguments passed when the program launches, how do I add those to a
fixed desktop shortcut on my users' machines? And If I'm launching
said program from a System.Diagnostics.Process.Start line of code how
would I do it there? OK, I could probably figure out that second one
myself but I haven't been able to search and find an answer on the
first question.

Bob
Oct 28 '08 #1
4 4331
"RvGrah" <rv****************@sbcglobal.netwrote in message
news:d3**********************************@f40g2000 pri.googlegroups.com...
If I add "string[] args" to the Program.cs file so that there can be
arguments passed when the program launches, how do I add those to a
fixed desktop shortcut on my users' machines? And If I'm launching
said program from a System.Diagnostics.Process.Start line of code how
would I do it there? OK, I could probably figure out that second one
myself but I haven't been able to search and find an answer on the
first question.
Well, what are you using to create this shortcut?
Oct 28 '08 #2

http://www.google.com/search?hl=en&q...rocess.Start+a

?

Brad Abrams comes up as my first hit.

"RvGrah" <rv****************@sbcglobal.netwrote in message
news:d3**********************************@f40g2000 pri.googlegroups.com...
If I add "string[] args" to the Program.cs file so that there can be
arguments passed when the program launches, how do I add those to a
fixed desktop shortcut on my users' machines? And If I'm launching
said program from a System.Diagnostics.Process.Start line of code how
would I do it there? OK, I could probably figure out that second one
myself but I haven't been able to search and find an answer on the
first question.

Bob

Oct 28 '08 #3
For the purpose of testing and development, just right-clicking the
exe and choosing "Create Shortcut".

I figured out what I was doing wrong, I was thinking there'd have to
be a switch, like a dash or slash, but in fact all you do is leave a
space after the path and then add your argument as plain text, no
quotes, in the "Target" box. Turned out to be the only syntax
variation I hadn't tried!

As I thought figuring how to launch it from Process.Start was very
easy, just put a comma and the overload list tells you what it wants
next.

Thanks guys.

On Oct 28, 8:24*am, "Jeff Johnson" <i....@enough.spamwrote:
"RvGrah" <rvgrahamsevaten...@sbcglobal.netwrote in message

news:d3**********************************@f40g2000 pri.googlegroups.com...
If I add "string[] args" to the Program.cs file so that there can be
arguments passed when the program launches, how do I add those to a
fixed desktop shortcut on my users' machines? And If I'm launching
said program from a System.Diagnostics.Process.Start line of code how
would I do it there? OK, I could probably figure out that second one
myself but I haven't been able to search and find an answer on the
first question.

Well, what are you using to create this shortcut?
Oct 28 '08 #4
"RvGrah" <rv****************@sbcglobal.netwrote in message
news:d2**********************************@k36g2000 pri.googlegroups.com...
I figured out what I was doing wrong, I was thinking there'd have to
be a switch, like a dash or slash, but in fact all you do is leave a
space after the path and then add your argument as plain text, no
quotes, in the "Target" box.
Well, if your argument contains spaces then you SHOULD put quotes around it.
Oct 29 '08 #5

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

Similar topics

1
by: Mike Vieths | last post by:
I'm running into a problem when I try to run commands with os.execv. It seems to be putting quotation marks around each element of the list passed as its second argument. This is fine for the...
7
by: Steve M | last post by:
I'm trying to invoke a Java command-line program from my Python program on Windows XP. I cannot get the paths in one of the arguments to work right. The instructions for the program describe the...
5
by: randyelliott | last post by:
Good Day, I have a MS Access (Access 2000 now upgraded to 2003) database that tracks customer information. One function of this database is to create an encrypted license file for our software,...
6
by: Edd Dawson | last post by:
Hi. I have a strange problem involving the passing of command line arguments to a C program I'm writing. I tried posting this in comp.programming yesterday but someone kindly suggested that I'd...
2
by: SunRise | last post by:
Hi I am creating a C Program , to extract only-Printable-characters from a file ( any type of file) and display them. OS: Windows-XP Ple help me to fix the Errors & Warnings and explain...
6
by: =?Utf-8?B?Rm9ycmVzdCBIZWxsZXI=?= | last post by:
The only code that is helpful is this: fp = New IO.StreamReader(filename, New System.Text.UnicodeEncoding(True, False), False) If I pass a command line argument to my program that is not from...
0
by: ewokspy | last post by:
I am trying to add an uninstall shortcut to the user's program directory upon installation of my application. I utilized the following website: Adding Uninstall Shortcut And then conformed the...
11
by: Jim | last post by:
Hi, I want to schedule a Python program that reads the command line for input. However, when adding an argument to the command line Python will not pick it up when using Windows scheduled...
51
by: Ojas | last post by:
Hi!, I just out of curiosity want to know how top detect the client side application under which the script is getting run. I mean to ask the how to know whether the script is running under...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.