Help - Search - Members - Calendar
Full Version: Another Batch Question [variables]
BleepingComputer.com > Software > Programming
   
memorex2930
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
bojo
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.
memorex2930
thanks for your help
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.