Escape Character

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
alexandredneto
Posts: 39
Joined: 28 Feb 2013 13:40

Escape Character

#1 Post by alexandredneto » 26 Jun 2015 11:05

Hello, everyone.

The content of the WS script variable (below) has a space.
And it generates an error. It can be used escape characters? If yes, how can it be done?

Thank you.

Code: Select all

@echo off
SET STRCOMPUTER=Server003
SET STRLOGIN=%1
SET WS="ws0910 Ord_51x.bat.lnk"

if not exist "\\%STRCOMPUTER%\C$\Documents and Settings\%STRLOGIN%\Desktop\%WS%" (
goto status_negative
)
echo Yes
goto sair

:status_negative
echo No
goto sair

:sair

C:\TEMP>test.bat 12365401
'Ord_51x.bat.lnk""' is not recognized as an internal or external command,
operable program or batch file.
No

C:\TEMP>

Yury
Posts: 115
Joined: 28 Dec 2013 07:54

Re: Escape Character

#2 Post by Yury » 26 Jun 2015 11:37

Code: Select all

SET "STRCOMPUTER=Server003"
SET "STRLOGIN=%1"
SET "WS=ws0910 Ord_51x.bat.lnk"

Post Reply