Question : ADM template for an environmental varible

I need help creating a custom ADM file that I can use as part of my group policy for setting a system evironmental varible.  I can't seem to find the spcific information how to do this.

The system environmental variable I would like to set is:
%WINSYSDIR%
and I would like to set it to the following path:
C:\WINDOWS\system32

Is this possible?

Answer : ADM template for an environmental varible

If you prefer to this by Group Policy, you will need to reboot the machine for it to take effect, below is the ADM.  I made it so that it can be applied to either a machine or a user, using either "Computer Configuration" or "User Configuration"

Machine Configuration writes it to:
"HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"

User Configuration writes it to:
"HKCU\Environment"

The key is a REG_Expand_SZ so will allow variables for instance, you can use %Windir%\System32 as the value rather than C:\Windows\System32.

Cheers
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CLASS MACHINE ;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CATEGORY !!ENV_MCHVAR
 
      POLICY !!MCH_SYSPOL
     EXPLAIN !!MCH_SYSEXP
     KEYNAME !!MCH_REGVAL
        PART !!MCH_SYSVAR EDITTEXT EXPANDABLETEXT REQUIRED
   VALUENAME !!SYS_VARVAL
    END PART
  END POLICY
 
END CATEGORY; !!ENV_MCHVAR
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CLASS USER ;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CATEGORY !!ENV_USRVAR
 
      POLICY !!USR_SYSPOL
     EXPLAIN !!USR_SYSEXP
     KEYNAME !!USR_REGVAL
        PART !!USR_SYSVAR EDITTEXT EXPANDABLETEXT REQUIRED
   VALUENAME !!SYS_VARVAL
    END PART
  END POLICY
 
END CATEGORY; !!ENV_USRVAR
 
[strings]
ENV_MCHVAR=Machine Environment Variables
ENV_USRVAR=User Environment Variables
 
MCH_SYSPOL=Machine System32 Environment Variable
USR_SYSPOL=User System32 Environment Variable
 
MCH_SYSEXP=Machine System32 Environment Variables\n\nTo Set: Type the path to ..\Windows\System32 Directory.\n\nYou may use other variables for example:\n%WinDir%\System32\n\nNote:The computer will require starting before this setting comes into affect.
USR_SYSEXP=User System32 Environment Variables\n\nTo Set: Type the path to ..\Windows\System32 Directory.\n\nYou may use other variables for example:\n%WinDir%\System32
 
MCH_REGVAL=SYSTEM\CurrentControlSet\Control\Session Manager\Environment
USR_REGVAL=Environment
 
MCH_SYSVAR=Path to C:\Windows\System32 Path  - example %WinDir%\System32
USR_SYSVAR=Path to C:\Windows\System32 Path  - example %WinDir%\System32
 
SYS_VARVAL=WINSYSDIR
Open in New Window Select All
Random Solutions  
 
programming4us programming4us