Page 1 of 1

Escape Character

Posted: 26 Jun 2015 11:05
by alexandredneto
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>

Re: Escape Character

Posted: 26 Jun 2015 11:37
by Yury

Code: Select all

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