----^--->
/\

//\\
//The\
/Sy
stem\
////
Guard
\

In the mount of the LORD it shall be seen. Genesis 22:14

GetRole

Booming Or Fuming? | MasterCatalog | ntlib (FREE) | NTCmdLib | MtCmds | Scripts | Almost Free | TheGuardBook | Help

 

Types of
.Mount/\Commands

.CrystalClear | .ExactName | .ExitELn | .GetValue | .ifCondition | .ifELn | .IsPattern | .ListValue | .NetValue | .NowValue | .RedirRapids | .ReliableReporting | .RestoreValue | .SetELn | .ValueEcho

.GetValue
Series

  .GetCD | .GetDate | GetDirSize | GetDirSizeM | GetFree | GetFreeM | GetIPAddr | GetIPGateway | GetIPMask | GetLogDate | GetLogTime | GetLogTimeP | GetMac | GetNic | GetOS | GetRole | GetTempFile | GetTime | GetTimeP

.GetRole

Description

  1. Displays the current Role (Server or Workstation)
  2. Saves the value in #Role
  3. Sets errorlevel based on the result

Syntax

%.GetRole%    

Parameters and Switches

none

   

Errorlevels and Output Variables

Display to
STDOUT

 

Value of
#Role

 

Error
Level

  Description of Result

Wkstn

 

Wkstn

  1   Workstation Operating System found

Server

 

Server

  2   Server Operating System found

Examples, Notes and Instructions

NT
2K
XP
C:\GuardPost>%.GetRole%
Wkstn
C:\GuardPost>ECHO:%Errorlevel%
1
C:\GuardPost>SET #Role
#Role=Wkstn
   
NT
2K
K3
C:\GuardPost>%.GetRole%
Server
C:\GuardPost>ECHO:%Errorlevel%
2
C:\GuardPost>SET #Role
#Role=Server

 


  • Output is displayed to STDOUT
  • To suppress console display, use

    %.GetRole% %.Quiet%

{errorlevel and output variable(s) will still be available}


Related .Mount/\Commands, #Constants, $Functions, :Procedures

Resource

  Short Description
.ifServer   TRUE if running on a Server OS.  Otherwise FALSE.
.ifNotServer   TRUE if NOT running on a Server OS.  Otherwise FALSE.
.ifWkstn   TRUE if running on a Workstation OS.  Otherwise FALSE.
.ifNotWkstn   TRUE if NOT running on a Workstation OS.  Otherwise FALSE.
.ifDC   TRUE if running on a Domain Controller.  Otherwise FALSE.
.ifNotDC   TRUE if NOT running on a Domain Controller.  Otherwise FALSE.
#Role   Operating System Role (Server,Wkstn)

 

K

E

Y

Common Commands INTERNAL External /SWITCH Parameter Help text AddonTool
Mounted Commands .Mount/\Command CmdShorthand #Constant $FUNCTION :Procedure !GuardNote
Operating Systems NT/2K/XP/K3 NT Only NT/2K 2K Only 2K/XP XP Only XP/K3 K3 Only 2K/XP/K3

.GetValue
Series

  .GetCD | .GetDate | GetDirSize | GetDirSizeM | GetFree | GetFreeM | GetIPAddr | GetIPGateway | GetIPMask | GetLogDate | GetLogTime | GetLogTimeP | GetMac | GetNic | GetOS | GetRole | GetTempFile | GetTime | GetTimeP
/\
//\\
//
The\
/Sy
stem\
////
Guard
\
COME ON UP WITH US!
and
Congratulations On Your Decision
to
RISE ABOVE
THE REST!

^
/
!\
/LIB\

TheSystemGuard.com [Revised: 2007-03-29]
Copyright © 1995-2007, JWC
Computer Communications,
All Rights Reserved, Worldwide.
 Disclaimer       Privacy       About Us       More


Communication Is Business!

We Master It With Knowledge!

^
/
.\
/M^C\