#196786 - 2009-11-20 01:21 PM
Display @ Character
|
Murraymint
Fresh Scripter
Registered: 2008-05-16
Posts: 5
Loc: West Sussex, United Kingdom
|
Simple question if you know the answer, how do I display the @ symbol. I am trying to build a dynamic script and I want to write @echo off but all I get in the batch file is <unknown:echo off.
Here's my code.
If $EncryptMyDocs = "TRUE"
Open(1, "D:\script\encrypt.bat", 5)
If @ERROR = 0
WriteLine(1,"@"+"echo off"+@CRLF)
WriteLine(1, "CIPHER /E /S:" + '"$mydocs"' + " /A" + @CRLF)
Close(1)
Else
Open(2, "D:\script\Error.log", 5)
WriteLine(2, "file could not be opened" + " " + @ERROR)
Goto "Exit"
EndIf
EndIf
Edited by Murraymint (2009-11-20 01:25 PM)
|
|
Top
|
|
|
|
#196787 - 2009-11-20 01:59 PM
Re: Display @ Character
[Re: Murraymint]
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
It's a reserved character that introduces a macro, documented early in the manual. Other reserved characters are "$" and "%".
There are a number of ways to skin this cat, but the simplest is to repeat the reserved character:
$vDiscard=WriteLine(1,"@@"+"echo off"+@CRLF)
|
|
Top
|
|
|
|
#196792 - 2009-11-20 03:05 PM
Re: Display @ Character
[Re: Richard H.]
|
Murraymint
Fresh Scripter
Registered: 2008-05-16
Posts: 5
Loc: West Sussex, United Kingdom
|
Richard do you wnat a job 
I do remember reading about the $ and needing to $$, guess I should start at the beginning of the manual again.
Thanks again.
Murray
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 756 anonymous users online.
|
|
|