»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 10-11-2003, 07:52 AM   #1 (permalink)
Registered User
 
Join Date: Aug 2003
Posts: 17
Pritesh is on a distinguished road
Echo-ing a variable in a bat file

Hi all,
And thanks for helping in advance.

I have a slight problem with my bat script, yes again. lol.
I have used the "set" command to set a variable in dos. eg

Set 1=hello

if i type in at the prompt: echo %1%, i get this "hello"
now if i put that same command in to a bat file nothing comes back. its as if the variable is not set, i have tried so many different things such as enclosing in "", and adding the '.' after echo, nothing seems to get the bat file to return my variable.

Please, please, please, please, please, please can someone help me as i am about to hair out my head.

Thank you so much

Pritesh

Pritesh is offline   Reply With Quote
Old 10-11-2003, 07:56 AM   #2 (permalink)
Guest
Guest
 
Posts: n/a
Try "ECHO ON" at the beginning of your batch file, or before wherever you want the ECHO to start. "ECHO OFF" to get no ECHO to the screen.
  Reply With Quote
Old 10-11-2003, 08:24 AM   #3 (permalink)
Registered User
 
Join Date: Aug 2003
Posts: 17
Pritesh is on a distinguished road
Thanks EvilRcik, but it didn't work

Thanks evilrick, but that doesn't work.
I tried it just now, and it doesn't return the variable via the bat file.
Still need help with this one,
Please please please can some one stop these marbles rolling in my head.
Thanks guys
Pritesh is offline   Reply With Quote
Old 10-11-2003, 08:46 AM   #4 (permalink)
Registered User
 
Join Date: Aug 2003
Posts: 17
Pritesh is on a distinguished road
I found out how to make it work

Hi guys,
Yes i stopped the marbles rolling, i stopped pulling out my hair
the answer to the question above in case if anyone asks this question in the future is:

instead of using a variable "1" try using a variable like "one"
for some reason the numbers don't work properly with bat files, but the words do.

Nice one people.

Thanks for the help, and thank you evilrick for guidence, paid off.

Cheers everyone

Pritesh
Pritesh is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 03:14 PM.