Special characters in batch files?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Cat
Posts: 32
Joined: 11 Nov 2011 12:04

Special characters in batch files?

#1 Post by Cat » 14 Nov 2011 14:36

This is a picture of a batch game I'm making.

http://i44.tinypic.com/qpfdpd.png

I use ± for the blocks, but how do i get rid of the underscores, and put a blank space instead? Alt + 0160 doesn't work, and neither does Alt + 255. How do i place an empty, blank space when a variable is echoed without the variable being nul?

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

Re: Special characters in batch files?

#2 Post by Ed Dyreen » 15 Nov 2011 04:23

'
What is the problem, cant you just echo a space ( not a special char ) ?

Cat
Posts: 32
Joined: 11 Nov 2011 12:04

Re: Special characters in batch files?

#3 Post by Cat » 15 Nov 2011 14:36

Using "ECHO " will result as "ECHO is on." Also, you can't set a variable to a space.

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

Re: Special characters in batch files?

#4 Post by Ed Dyreen » 15 Nov 2011 14:43

'
thanks, I didn't realize that :roll:

Code: Select all

@echo off
set "$space= "
echo.%$space%
echo. %= space =%
for /l ( 1, 1, 1000 ) do <nul set /p "= I H A V E A L O T O F S P A C E "
pause

colargol
Posts: 49
Joined: 28 Sep 2011 13:23
Location: france

Re: Special characters in batch files?

#5 Post by colargol » 15 Nov 2011 16:28

Code: Select all

echo( 
(with a space after parenthesis)
should work, no?

Post Reply