Computing.Net > Forums > Programming > %var% from a txt file vbs

%var% from a txt file vbs

Reply to Message Icon

Original Message
Name: masimar
Date: May 26, 2006 at 17:34:51 Pacific
Subject: %var% from a txt file vbs
OS: na
CPU/Ram: na
Model/Manufacturer: na
Comment:

I'm trying to write a vb script for windows xp that will read a list of clsids from a text file then build a vbscript to build a batch file based on them.

I set the name= with for /f and can then name the vbscripts and batch files with the variable and also use the same variable to find the dll associated with the clsid.

All is well until I try to echo these two lines:
echo strFileName = fs.BuildPath(Wscript.ScriptFullName & "\..", "%name%.bat")>>%name%.vbs

echo ts.WriteLine "echo " & (namedValueValue) & ">>%name%.txt"

I don't have a clue how to get those written just as they are. Can somebody please help?

Mark


Report Offensive Message For Removal

Response Number 1
Name: IVO
Date: May 27, 2006 at 02:35:06 Pacific
Subject: %var% from a txt file vbs
Reply: (edit)

Try to prefix the & with a caret ^, i.e. ^& so forcing the interpreter to process & as a normal character.


Report Offensive Follow Up For Removal

Response Number 2
Name: masimar
Date: May 27, 2006 at 06:37:01 Pacific
Subject: %var% from a txt file vbs
Reply: (edit)

Thanks for the answer. Ignorance is supposed to be bliss, but it's pretty stressful if you ask me.

Mark


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: %var% from a txt file vbs   

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software