473,800 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Diagnost ics.Process.Sta rt 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 4358
"RvGrah" <rv************ ****@sbcglobal. netwrote in message
news:d3******** *************** ***********@f40 g2000pri.google groups.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.Diagnost ics.Process.Sta rt 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******** *************** ***********@f40 g2000pri.google groups.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.Diagnost ics.Process.Sta rt 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.s pamwrote:
"RvGrah" <rvgrahamsevate n...@sbcglobal. netwrote in message

news:d3******** *************** ***********@f40 g2000pri.google groups.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.Diagnost ics.Process.Sta rt 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******** *************** ***********@k36 g2000pri.google groups.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
3549
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 most part, but if the argument has a space in it, getopt (in the command being called) will read the entire quoted string as the argument and generally fail. Here's an example: Python 2.2.2 (#1, Jan 30 2003, 21:26:22) on linux2
7
4739
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 following for the command-line arguments: java -jar sforcedataloader.jar -Dsalesforce.config.dir=CONFIG_DIRECTORY They also give an example:
5
3225
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, which is then emailed out to the customer. The encryption string is based on information in the database and can only be generated by executing a DOS command. This is done from within the database by clicking a button on a form that triggers a...
6
2939
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 have better luck here. So here goes! My program ignores any command line arguments, or at least it's supposed to. However, when I pass any command line arguments to the program, the behaviour of one of the functions changes mysteriously. I have...
2
4203
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 how to use Command-Line Arguments inside C program.
6
2363
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 Visual Studio.NET is debug mode, the above code won't work, even though filename is not changed whether I pass a command line argument or not. By not work, I mean it will set fp.EndOfStream to true and fp.Peek() returns -1. The command line argument...
0
2137
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 code to C# in this manner: static void CheckUninstall() { string arguments = System.Environment.GetCommandLineArgs(); char delimiter = new char;
11
3397
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 tasks. How do I get it to work? Thanks, Jim
51
4165
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 Command Prompt or Browser or some other application? Ojas.
0
9690
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10505
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10275
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9085
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7576
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.