Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Start A Program with its command-line parameters  (Read 2347 times)

0 Members and 1 Guest are viewing this topic.

CaptainObvious

  • Guest
Start A Program with its command-line parameters
« on: May 19, 2006, 03:51:02 AM »
Hey guys,

Joined the forums just so I can ask this noobie question. As the subject states, I want to create a batch file that starts an App with its command-line parameters  in place. Please note that i am not refering to a program shortcut.
Here is an example of the App I wanna launch with its paramaters ("I:\demo\SushiDX.exe" -debug) How do I turn this into a bat file.  If I make this a shortcut, it works fine, but when its  in batch format i get errors.

THanks guys
« Last Edit: May 19, 2006, 03:52:05 AM by CaptainObvious »

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: Start A Program with its command-line paramete
« Reply #1 on: May 19, 2006, 05:22:11 AM »
Some programs need to be logged in to the directory where the excutable is. You didn't mention which version of Windows you have, but this should run in all of them:

Code: [Select]
I:
cd \demo
SushiDX.exe -debug

Shortcuts have the "Start in" parameter which can point to the executable directory. In batch language, you have to duplicate the result using a different technique.

Hope this helps. 8-)
« Last Edit: May 19, 2006, 05:22:41 AM by Sidewinder »
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

CaptainObvious

  • Guest
Re: Start A Program with its command-line paramete
« Reply #2 on: May 19, 2006, 06:49:15 AM »
Hey Sidewinder,

Let me clear up any confusion, first off my OS is XP SP2, and My "I" drive is a HDD. The following is the full path to the program
Code: [Select]
I:\ATI Demos\DoubleCross\SushiDX.exe what code Do I type for the above to work?

Thanks

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: Start A Program with its command-line paramete
« Reply #3 on: May 19, 2006, 07:23:26 AM »
I'd still use the same method:

Code: [Select]
I:
cd "\ATI Demos\DoubleCross"
SushiDX.exe -debug
Not sure if you still want the -debug switch.

There are other ways to do this but:

Quote
If I make this a shortcut, it works fine, but when its  in batch format i get errors.
we don't what errors, so the best solution if one that can be done on any machine. 8-)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

CaptainObvious

  • Guest
Re: Start A Program with its command-line paramete
« Reply #4 on: May 19, 2006, 07:38:46 AM »
Thanks for the quick reply.

Okay I think I understand now. The "CD" in your code stands for "change directory" right? I'll give it a try and let you know if it works
« Last Edit: May 19, 2006, 07:40:23 AM by CaptainObvious »