PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.win.server.scripting > RE: code to parse logon servername and exit if name start w/abc*
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
RE: code to parse logon servername and exit if name start w/abc*

Réponse
 
LinkBack Outils de la discussion
Vieux 22/11/2007, 20h48   #1
Andrew Karmadanov
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut RE: code to parse logon servername and exit if name start w/abc*

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

  Réponse avec citation
Vieux 24/11/2007, 03h10   #2
Al Dunbar
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: code to parse logon servername and exit if name start w/abc*

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



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h10.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09504 seconds with 10 queries