Solved

Passing input parameter to batch file that contains equal sign

Posted on 2007-03-30
6
3,357 Views
Last Modified: 2013-12-04
I have the following command from a UNIX system that will launch a batch file on a Windows system.
The batch file simply calls up an IE session with the URL that is the input parameter to the batch file.

rsh hostname -l username c:\\temp\\test.bat "http://xxx.xxxl.com/Add.asp?ABC=xx&DEF=yy"

The problem is that the batch file does not recognize the "=" sign
It also gives me this
    'DEF'' is not recognized as an internal or external command
so it may be having trouble with the "&" sign.

How can i pass a URL to a batch file where the URL contains "=" and "&" signs?
0
Comment
Question by:RudePuppyDog
  • 3
  • 2
6 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 18824882
I assume there is a problem with the contents of the batch file. If you just use

set URL=%1
echo %URL%

and call that like

test "http://xxx.xxxl.com/Add.asp?ABC=xx&DEF=yy"

that works fine.
0
 

Author Comment

by:RudePuppyDog
ID: 18825516
When it opens the IE window, the URL is

http://xxx.xxxl.com/Add.asp?ABC
      so I think its getting confused with the "=" in the URL

set URL=http://xxx.xxxl.com/Add.asp?ABC=xx&DEF=yy    would have multiple "=" signs.

0
 
LVL 86

Expert Comment

by:jkr
ID: 18825572
Even

set URL=%1
echo %URL%

"%ProgramFiles%\Internet Explorer\iexplore.exe" %URL%

as the batch file works fine.
0
 
LVL 86

Accepted Solution

by:
jkr earned 250 total points
ID: 18825579
Note that you need the quotes, though. I assume that the rsh command expansion removes them, try to escape them on the UN*X side as

export URL ="\"http://xxx.xxxl.com/Add.asp?ABC=xx&DEF=yy\""
rsh hostname -l username c:\\temp\\test.bat $URL
0
 

Author Comment

by:RudePuppyDog
ID: 18840518
Closer, but when I escape the quotes on the UNIX side, the browsers opens up with the following URL:
       http://xxx.xxxl.com/Add.asp?ABC=xx

Its dropping the "&" and everything after that.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This article will show, step by step, how to integrate R code into a R Sweave document
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now