Need assistance creating batch file with arguments

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
alexnet
Posts: 1
Joined: 17 Nov 2011 09:49

Need assistance creating batch file with arguments

#1 Post by alexnet » 17 Nov 2011 09:54

I have a client who needs to run a program on a Windows 2008 R2 terminal server in RemoteApp. RemoteApp allows for command line arguments when launching published apps but it's not working so I'm resorting to a batch file.

The shortcut on the desktop of this server actually runs and launches the program exactly as it should. This is what I am trying to emmulate in a batch file.

Windows Shortcut info:
Target: "C:\Program Files (x86)\ASI\iMIS15\Omnis7\Omnis7.exe" imis4.lbr /m
Start In: "C:\Program Files (x86)\ASI\iMIS15\"
Shortcut Key: None
Run: Normal Window
Comment: iMIS Desktop

If someone could assist with creating the script, that would be great. Below is what I have started with but I don't think I'm on the right track as I'm not a programmer and don't understand the swtiches and variables enough to make this work.

What we are trying to accomplish it to have it automatically run/load the imis4.lbr file located in the arg1 part of the script below.
===
::My batch file attempt
set arg1=%~p1 "C:\Program Files (x86)\ASI\iMIS15\imis4.lbr /m"

START "NCPA Prod iMIS Database" /max "C:\Program Files (x86)\ASI\iMIS15\Omnis7\Omnis7.exe" %arg1%

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Need assistance creating batch file with arguments

#2 Post by Ed Dyreen » 18 Nov 2011 09:32

'
start "!File!" /low %PreFetch% "%comspec%" !CMDLeaveRunning! " "!FullPathFile!" !Parameters! "
start "!File!" /low %PreFetch% /D "!FullPath!" "%comspec%" !CMDLeaveRunning! " "!File!" !Parameters! "
start "!File!" /low %PreFetch% "!FullPathFile!" !Parameters!

try:

Code: Select all

start "NCPA Prod iMIS Database" /max "C:\Program Files (x86)\ASI\iMIS15\Omnis7\Omnis7.exe" "C:\Program Files (x86)\ASI\iMIS15\imis4.lbr" /m"
or

Code: Select all

start "NCPA Prod iMIS Database" /max /D "C:\Program Files (x86)\ASI\iMIS15\Omnis7" "%comspec%" /c " "Omnis7.exe" "C:\Program Files (x86)\ASI\iMIS15\imis4.lbr" /m"

Post Reply