1.

Solve : copy from within batch file to a text file ERROR!?

Answer»

i am trying to copy the line below to a new text file using batch file. The line is given below

objIEA.Navigate "http://"&WScript.Arguments(0)&"/VIDEO?session=3&alphabet=83&channel="&WScript.Arguments(1)&"&profile="& WScript.Arguments(2)

This is the line. what i did is something LIKE this and i am getting error while executing batch file.

ECHO objIEA.Navigate "http://"&WScript.Arguments(0)&"/video?session=3&alphabet=83&channel="&WScript.Arguments(1)&"&profile="& WScript.Arguments(2) > test.txt

THe above command is giving me error. I want to copy the exact line shown above to a new file and in reality the new file will have .vbs extension. i mean the new file in reality should be test.vbs but it is not working for even test.txt

please helpThe AMPERSAND (&) character is a control character in batch, it is the command separator, and if you want to use it in an ECHO statement you have to "escape" it with a caret (^), unless it is within quotes.

Code: [Select]ECHO objIEA.Navigate "http://"^&WScript.Arguments(0)^&"/video?session=3&alphabet=83&channel="^&WScript.Arguments(1)^&"&profile="^& WScript.Arguments(2) > test.vbs
Code: [Select]C:\>echo hello & goodbye
hello
'goodbye' is not recognized as an internal or external command,
operable PROGRAM or batch file.

C:\>echo hello ^& goodbye
hello & goodbye

C:\>echo "hello & goodbye"
"hello & goodbye"
thank you very much. very much appreciated



Discussion

No Comment Found