yaos Posted August 19, 2008 Share Posted August 19, 2008 (edited) Here's what I tried.Regular expression, which I can't even begin to understand. I also tried the StringSplit function with @ScriptDir which returns correctly when run on my computer but does not work when running from the server, the array returns with multiple elements but they are all blank. I am using the correct forward slashes when I test on the server ( //servername/ ) . The @ScriptDir works correctly on the server, just not the StringSplit for some reason.What I'm trying to do is find the server name, or IP address if there is no server name. For example, //coolserver/adirectory/anotherdirectory/lotsofdirectories and the server name would be "coolserver". I can then use the name to IP function to find the IP address if I need to do so.Is there a simple way to get the server name that I passed over? Edited August 19, 2008 by yaos Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 19, 2008 Share Posted August 19, 2008 Here's what I tried. Regular expression, which I can't even begin to understand. I also tried the StringSplit function with @ScriptDir which returns correctly when run on my computer but does not work when running from the server, the array returns with multiple elements but they are all blank. I am using the correct forward slashes when I test on the server ( //servername/ ) . The @ScriptDir works correctly on the server, just not the StringSplit for some reason. What I'm trying to do is find the server name, or IP address if there is no server name. For example, //coolserver/adirectory/anotherdirectory/lotsofdirectories and the server name would be "coolserver". I can then use the name to IP function to find the IP address if I need to do so. Is there a simple way to get the server name that I passed over? #Include <String.au3> $sString = "\\SomeServer\SomeShare\SomeFolder" $avPath = _StringBetween($sString, "\\", "\") MsgBox(64, "Server", $avPath[0]) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
yaos Posted August 19, 2008 Author Share Posted August 19, 2008 #Include <String.au3> $sString = "\\SomeServer\SomeShare\SomeFolder" $avPath = _StringBetween($sString, "\\", "\") MsgBox(64, "Server", $avPath[0]) I tried so hard, but in the end it didn't even matter. Thank you very much. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now