Microsoft KB Archive/931082

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 17:36, 18 July 2020 by 3155ffGd (talk | contribs) (importing KB archive)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Base


How to obtain a directory value in Profile Maker

Article ID: 931082

Article Last Modified on 2/14/2007



APPLIES TO

  • Profile Maker Professional 8.0
  • Profile Maker Professional 9.0



INTRODUCTION

This article describes how to obtain a directory value in Desktop Standard Profile Maker.

MORE INFORMATION

To obtain a directory value and store it in an environment variable for use in Profile Maker, follow these steps:

  1. Paste the following script in a text file. Then, save the text file as Obdirvalue.vbs.

    ' VBScript to determine the server name of the user's mapped
    ' home directory or the drive letter of the local home directory
    ' and pass that value to Profile Maker as an environment
    ' variable named %HomeServer%
    
    ' Enable error handling and prevent error messages On Error Resume Next 
    
    Dim objUser Dim wshShell 
    Dim wshEnv 
    Dim nPos 
    Dim strServer
    
    ' get home directory from server 
    Set objUser = GetObject("WinNT://%UserDomain%/%UserName%") 
    
    ' parse out server name (or drive letter if local) 
    nPos = InStr(3, objUser.HomeDirectory, "\") 
    strServer = Left(objUser.HomeDirectory, nPos-1) 
    
    ' set value into volatile variable for Profile Maker 
    ' will set to empy string if error occurred or value not set 
    Set wshShell = Wscript.C
  2. At the command prompt, move to the folder in which you saved the file in step 1.
  3. Type the following command, and then press ENTER:

    cscript obdirvalue.vbs


Keywords: kbhowto kbexpertiseinter kbinfo KB931082