截屏视频帮助

While Statement

创建时间: 07 2 月 2013 • Updated: 08 2 月 2013 | 5 条评论
此问题已解决。 请查看解决方案。

Hi,

I'm finding it difficult to do something and wondered if I may call upon some assistance.
Infact it's difficult for me to explain so will try my best here. My issue is actually the same problem as in this thread which is explained better. I'm trying to add some extra functionality to the end of it...

https://www-secure.symantec.com/connect/forums/wisescript-how-populate-custom-dialog-list-box-multiline-variable

Is there anyway to seperate a variable such as %SERVERS% which contain data such as \\SERVER1 \\SERVER2 \\SERVER3 \\SERVER4 \\SERVER5
these would all be in one string, to form 5 command lines like this...

\\SERVER1\program.exe
\\SERVER2\program.exe
\\SERVER3\program.exe
\\SERVER4\program.exe
\\SERVER5\program.exe

Somehow in a While Statement? although I'm struggling to put a condition into it.

In more detail this is what I'm trying to do....

I'm generating a list of servers on the network from running a NET VIEW command and outputing the contents to a file called servers.txt
Then I'm tidying it up a bit with some magic to remove empty lines and other characters I don't need.
Once this is done, I take that file and read it back in line by line to a variable called %MACHINE%
Then I set a new variable called %SERVERS% based on %MACHINE%%CRLF% and have a listbox showing me my server list.
You can select one or many servers from the list and the ones you select are sent to RESULT but they're in the format as shown above like \\SERVER1 \\SERVER2 etc

I want to build a command line up with these server names now but I can't figure out how to do it.

Can anyone help me?

I've attached what I have so far if that helps.

讨论 归类至以下社区:

评论 条评论跳转至最新评论

EdT 的图片

Can you supply an example servers.txt file?

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

Paul1977 的图片

Here you go, mailed also.

附件大小
servers.txt 4.03 KB
EdT 的图片

I have emailed you a short wisescript which does the parsing without any need for external vbscripts.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

解决方案
Paul1977 的图片

Ed, absolutly fantastic, I have the script and it works great. Never actually thought of parsing variables more than once to get what I need. Have a few more bits to put in to it, should be fine from here onwards, thanks again.