Comand line and special character

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
top megacool
Posts: 1
Joined: 22 Nov 2020 12:07

Comand line and special character

#1 Post by top megacool » 22 Nov 2020 12:19

Hello there,

I have to drive a relay with a commande line which is : CommandApp_USBRelay.exe ÿÿÿÿÿ open 01
this works perfectly if I use the command line in the CMD windows but not in a BAT file.

ÿÿÿÿÿ is the relay ID and is the problem whe nusing inside a .BAT file.


I have another relais with a different ID which is : 959BI and in this case, no problem, it works in a BAT file.

I tryed a few things, cote, slash.. but can"t find a way to force it.


Any idea ?

Thanks
TMC
Last edited by aGerman on 22 Nov 2020 14:46, edited 1 time in total.
Reason: advertising link removed

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Comand line and special character

#2 Post by aGerman » 22 Nov 2020 14:48

Try a CHCP 1252 before you're calling the executable.

Steffen

aschipfl
Posts: 9
Joined: 13 Feb 2019 03:33

Re: Comand line and special character

#3 Post by aschipfl » 23 Nov 2020 18:31

top megacool wrote:
22 Nov 2020 12:19
ÿÿÿÿÿ is the relay ID and is the problem whe nusing inside a .BAT file.
I bet the character ÿ has got the code 0xFF, which is seen as the non-break space (NBSP) and constitutes a standard token separator, just like: SPACE TAB , ; = VTAB FF.
I guess escaping each by ^ like ^ÿ^ÿ^ÿ^ÿ^ÿ is not going to help yet worth a try. Or does the application allow quotation of its arguments, like "ÿÿÿÿÿ" to protect these special characters? Changing the code page in addition as already suggested) might also help; I would also try CHCP 437

Post Reply