Link to home
Start Free TrialLog in
Avatar of hansbos
hansbos

asked on

Problem with echo of escape codes in batch file

The following line in a batch file works in Win98 but not in WinNT.

echo &l0O&l8D(s12H >> TEST.UTV

The first character after the echo is the Escape character (ascii 27).
The purpose is to add some printer-format codes to a file to switch from portrait to landscape, but on WinNT I get the response:

The name specified is not recognized as an internal or external command.

Avatar of percy_k
percy_k

Try this

echo ^[^&l0O^[^&l8D^[(s12H >> TEST.UTV

Percy
Avatar of hansbos

ASKER

Percy,

Thanks for your comment. I tried your command but I didn't get the escape codes in the file.
I already made a bypass by using the type command in combination with a file with the printer codes, but I was just curious if there was a way to echo the escape codes.

Hans
ASKER CERTIFIED SOLUTION
Avatar of percy_k
percy_k

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
Avatar of Tim Holman
NT doesn't provide ANSI support (flashy escape codes) in its command line.
However, you could configure autoexec.nt / config.nt to include the ANSI driver, open a DOS session, and then use escape codes to send to your printer.
Avatar of hansbos

ASKER

Percy,

Thanks. The "^"-character worked.

Hans