|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Should look like this:
LogonServer = UCase(Trim(LogonServer)) If Mid(LogonServer,1,5) <> "ABCDE" then Wscript.echo " some data" Else End If "Smoreno" wrote: > Hello, > > I have the following code on a login script to read the logon server name: > Set WSHShell = CreateObject("Wscript.Shell") > Set WSHProcess = WSHShell.Environment("Process") > LogonServer = WSHProcess("LogonServer") > > But now I am not sure how to parse the 'Logonserver' name to and skip ahead > in the script if the first 5 letters of the name are 'abcde' > > so what I need is something like: > > If logonserver name starts with 'abcde' then go to end > Wscript.echo " some data" > End > > Any will be appreciated > -- > Smoreno - ADOT |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Since the logonserver variable always shows the name prefixed with "\\",
this might be marginally simpler: LogonServer = UCase(Trim(LogonServer)) If Left(LogonServer,7) <> "\\ABCDE" then Wscript.echo " some data" End If /Al "Andrew Karmadanov" <AndrewKarmadanov@discussions.microsoft.com> wrote in message news:50CB9CC9-926A-4251-B161-993D459B467C@microsoft.com... > Should look like this: > > LogonServer = UCase(Trim(LogonServer)) > If Mid(LogonServer,1,5) <> "ABCDE" then > Wscript.echo " some data" > Else > End If > > > "Smoreno" wrote: > >> Hello, >> >> I have the following code on a login script to read the logon server >> name: >> Set WSHShell = CreateObject("Wscript.Shell") >> Set WSHProcess = WSHShell.Environment("Process") >> LogonServer = WSHProcess("LogonServer") >> >> But now I am not sure how to parse the 'Logonserver' name to and skip >> ahead >> in the script if the first 5 letters of the name are 'abcde' >> >> so what I need is something like: >> >> If logonserver name starts with 'abcde' then go to end >> Wscript.echo " some data" >> End >> >> Any will be appreciated >> -- >> Smoreno - ADOT |
|
![]() |
| Outils de la discussion | |
|
|