|
|
|||||||
I want to be able to be prompted at the dos prompt or whatever to prompt an input to an array. for example: -----output prompt example------- Enter in server names: srv1, srv2, mail2, srv5 -----------code example--------of what I want----- $servers = prompt(Enter in server names:, "") |
||||||||
|
|
|||||||
There's the GETS command, which you can turn into an array: Code: ? "Enter in server names, separated by commas: " gets $foo $severs = split($foo,",") |
||||||||
|
|
|||||||
You can use Gets, but the input will be a string. In order for it to be an array you will have to split() the input. Something like: Code: ? "Type Input, seperated by commas" gets $input $input=split($input,",") for each $item in $input ? $item next |
||||||||
|
|
|||||||
thanks a lot guys. you dudes are awesome ! wow! this will help. I am building a server bounce program. I call it bounceWatch or bw.exe. I am going to compile it with the kix compiler. What it is going to do is this. Firs the the problem it will solve. Well I once a month check our servers and if they go over say 21 days or 30 days, I restart each one. I use the windows command shutdown -m \\pcnane -f -r to restart them. well I have decided since I do so many and I like to watch them come up before I go home to make sure they did come up.It takes a while to do say 20 servers. Yeah I could do a scheduled reboot but I am from school to watch them and make sure they are up. but anyhow, I will execuet bw.exe and then it will ask me to enter server names srv1, srv2, srv5, mail2 etc.. and then it will ask if i want to bounce them give me one last chance I have it loop and ask me for each one just in case I dont want to reboot one for some reason, after i say yes it will commence to reboot each one. then display a list of my server names I inputted one left column and then on right column as they come up (test ping in background) be displayed and auto refresh sort so the list is exacly the same order as the inputted one so when it is all done i will see all the same names of servers I bounce. then say success and maybe make a noice like tah dah!!!!!! that would be so cool if i can pull this off so to make it easier for me since I am lazy hahhahh plus watching them come up would be cool...so wish me luck and once I perfect will post it back here for you guys to tear up! haha but it will be a fun and useful project for me..;) thanks for your help! |
||||||||
|
|
|||||||
A couple of suggestions:
I've got some code knocking around somewhere that does pretty much what you are looking for. Try to get it working yourself (it's much more fun that way) and if you get stuck post again. |