Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Another Batch Question [variables]


  • Please log in to reply
2 replies to this topic

#1 memorex2930

memorex2930

  • Members
  • 5 posts
  • OFFLINE
  •  
  • Local time:08:10 AM

Posted 03 September 2005 - 05:28 PM

i was wondering if it was possible to have a variable within a variable.

i have this section of code from my messeging program i'm making:

set /p user=Send To:
set /p m=Message:
net send %%user%% %m%

the Send To: thing lets you type in a person to send to (e.g. Bob)
well in the environment variables, Bob=(the computer number)
how can i get the net send to equal net send %Bob% %m% ?????

thanks for any help anybody can give me

BC AdBot (Login to Remove)

 


#2 bojo

bojo

  • Members
  • 1 posts
  • OFFLINE
  •  
  • Local time:07:10 AM

Posted 04 September 2005 - 02:37 AM

It's not possible to have "variable in variable" in batch files. Actually, I guess, it's only possible in advanced programming languages which batch programming is not.

#3 memorex2930

memorex2930
  • Topic Starter

  • Members
  • 5 posts
  • OFFLINE
  •  
  • Local time:08:10 AM

Posted 04 September 2005 - 03:17 AM

thanks for your help




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users