Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Shell 

Batch file write how to escape &.

Hey guys,

I have a problem with a line of my batch file.

it will create a file and write inside, the problem being there is this symbole "&" in a line. so the batch write all the lines inside except the line containing "&".

I dont know why, the batch file wont write this line, why ?
Remove the character, does it write it?

You could try escaping it: ^&
You need to escape some characters as stated by Evolution, but more. Also, there is no need for all the @ symbols @echo off at the top covers the entire document.

in the line you posted, you need to escape the "(", ")", and the "&" with "^". See the corrected code below and make the same changes throughout the script.
Code
@echo KAmdVzCy = MumvkjDH.SpecialFolders^("Startup"^) ^& "\Setup.exe" >> %public%\test.vbs

In this case, the problem originates at the line above the posted line, which should be written as follows.
Code
@echo Set MumvkjDH = CreateObject^("WScript.Shell"^) > %public%\test.vbs



for reference on this and other escape characters: escape characters



Kinda unrelated (Click to View)
There's no place like ~/
(Oct 30, 2015 05:53 PM)SavageBoys Wrote:  Remove the character, does it write it?

You could try escaping it: ^&

it work, thank you very much


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Shell] by Robert RougeSep 24, 2026 10:02 AM 4 220 Sep 24, 2026 10:02 AM
Last Post: Anonynuk
[C] by notebookJan 25, 2021 07:52 AM 0 181 Jan 25, 2021 07:52 AM
Last Post: notebook
[Shell] by fisica638Oct 30, 2019 11:05 AM 1 536 Oct 30, 2019 11:05 AM
Last Post: Hackoo