Link to home
Start Free TrialLog in
Avatar of qbjgqbjg
qbjgqbjgFlag for United States of America

asked on

windows bat file continuation line

I am trying to create a .bat file where some of the commands are too long too fit on one line. I saw that  ^
could be used as a continuation character. However, it has not worked. How do you type that character anyway? Any additional suggestions?
I have been using this code where everything is on one line with no problem.
"C:\Program Files\DataLink Viewer 11\DataLink_Viewer_11.exe" "Make_RPZ:L:\Internal Crystal Reports\Bettys Crystal\STORM^
\*.rpt>L:\Internal Crystal Reports\Bettys Crystal\STORM\DLV>0"

Open in new window

Avatar of qbjgqbjg
qbjgqbjg
Flag of United States of America image

ASKER

I do see that it is over the 6, so nevermind that part of the question.
Avatar of johnb6767
Honestly, I just widen my text editor (lower the font if needed), so that it all fits, and Im sure it fits properly......... Never had an issue, or a need to use a continuation character... Never known a command length limitation to restrict it.....
Possibly something like

set p1="C:\Program Files\DataLink Viewer 11\DataLink_Viewer_11.exe"
set p2="Make_RPZ:L:\Internal Crystal Reports\Bettys Crystal\STORM\*.rpt>L:\Internal Crystal Reports\Bettys Crystal\STORM\DLV>0"
 %p1% %p2%

set p1=
set p2=
I am actually building the commands for a list of entries in an excel spreadsheet. Many of them fit, but some are longer. I am already making the font very small. If there is a way to use continuation, that would be perfect.
This should work using the continuation character.  Can you test?

"C:\Program Files\DataLink Viewer 11\DataLink_Viewer_11.exe"   ^
"Make_RPZ:L:\Internal Crystal Reports\Bettys Crystal\STORM\*.rpt>L:\Internal Crystal Reports\Bettys Crystal\STORM\DLV>0"



I tried it. It still did not work.
Are you running this from a batch file or from Excel?
From a .bat
Operating System you are using?  May not work on 9x OSes.

And how are you saving these text files, with what application?

And if you have two lines like this

"abcd efgh" ^
"ijkl mnop"

make sure there is no space at the beginning of the second line.
Try this

"C:\Program Files\DataLink Viewer 11\DataLink_Viewer_11.exe"   ^
"Make_RPZ:L:\Internal Crystal Reports\Bettys Crystal\STORM\*.rpt"
pause

That is only part of your second line.  I've left out the redirection symbol >
Whats the error you get?

REM any echo off statements as well...
Will try again on Monday. I was not in Friday.
ASKER CERTIFIED SOLUTION
Avatar of Paul Tomasi
Paul Tomasi
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>bat files are new to me. I am unfamiliar with the commands. If I want to try Solution 5b, Will the Commands in the file look exactly like:
pushd "C:\Program Files\DataLink Viewer 11\"
DataLink_Viewer_11.exe "Make_RPZ:L:\Internal Crystal Reports\Bettys Crystal\STORM\*.rpt>L:\Internal Crystal Reports\Bettys Crystal\STORM\DLV>0"
popd

I am not sure this will always shorten it enough. But I will try it.



SOLUTION 5b
will work most of the time. I still would like to be able to have a continuation line, since that would always work. But I am accepting that answer as the solution, since the continuation character has not worked.
Thanks for the help.