LOCNAMES.EXE
During the operation of software in a multi-LANGUAGE environment one often is with that
Problem confronts that one is to use located paths. There is however for
To realize administrators always simply. Sometimes one has problems with that
Multi-LANGUAGE environment, because one within the server range a English-language server
and on the Client side e.g. the German Windows NT/XP. since Windows begins 2000 gives
it more environment variables,
like %ProgramFiles%, %CommonProgramFiles%, %ALLUSERSPROFILE% etc., those those
Administrators with this task to support are. We have however the experience
made that one needs more such environment variables in the reality substantially.
Among other things one often needs the data of user names or user groups
("administrator", "power users", "administrator", "Everyone" etc.), with that
Operating system are located.
With the assistance of utility LocNames.exe one can do the desired in a batch file
Environment variables dynamically activate. For the selection of listing names uses
LocNames.exe the API function SHGetFolderPath, the Microsoft for a long time in Windows
Logo program for set UP developers urgently recommends (see e.g..
http://www.microsoft.com/winlogo/software/downloads.mspx, "Designed for Windows XP
Application specification "and" Guidelines for Application "under
http://www.microsoft.com/whdc/hwdev/windowsxp/downloads/default.mspx).
Since one needs all environment variables only within a batch file, gives
LocNames.exe all demanded environment variable on the console out. By bypass
the output into a temporary file this file can immediately as a batch file called
become. Thus all appropriate environment variables are activated immediately in the batch.
Example:
@echo off
LocNames.exe/CommonDirs/SkipStdDirs > %TEMP%\t.cmd
call %TEMP%\t.cmd
del %TEMP%\t.cmd
:
Afterwards different environment variables can like e.g. in the batch file.
SET OK_SOFT_COMMON_STARTMENU=C:\Documents and Settings\All Users\Start menu
SET OK_SOFT_COMMON_PROGRAMS=C:\Documents and Settings\All Users\Start Menu\Programs
SET OK_SOFT_COMMON_STARTUP=C:\Documents and Settings\All Users\Start Menu\Programs\Startup
SET OK_SOFT_COMMON_DESKTOPDIRECTORY=C:\Documents and Settings\All Users\Desktop
:
are used. Appropriate paths point naturally to located listings of the
current computer.
We divided the different switches of the LocNames.exe into the following groups:
Switch for located account names and user groups:
· the switch / alias produces an output with the environment variables, those
different accounts of the BUILTIN domain contain. Often it is comfortable, that
Switch / alias together with the switch / short to use. Enclosed are two
Examples of the output of LocNames.exe with the switch / alias and without / short
Switch as well as with / short switches:
SET OK_SOFT_ALIAS_ADMINS=BUILTIN\Administrators
SET OK_SOFT_ALIAS_USERS=BUILTIN\Users
SET OK_SOFT_ALIAS_GUESTS=BUILTIN\Guests
SET OK_SOFT_ALIAS_POWER_USERS=BUILTIN\Power Users
SET OK_SOFT_ALIAS_BACKUP_OPS=BUILTIN\Backup Operators
SET OK_SOFT_ALIAS_REPLICATOR=BUILTIN\Replicator
SET OK_SOFT_ALIAS_REMOTE_DESKTOP_USERS=BUILTIN\Remote Desktop Users
SET OK_SOFT_ALIAS_NETWORK_CONFIGURATION_OPS=BUILTIN\Network Configuration Operators
SET OK_SOFT_ALIAS_ADMINS=Administrators
SET OK_SOFT_ALIAS_USERS=Users
SET OK_SOFT_ALIAS_GUESTS=Guests
SET OK_SOFT_ALIAS_POWER_USERS=Power Users
SET OK_SOFT_ALIAS_BACKUP_OPS=Backup Operators
SET OK_SOFT_ALIAS_REPLICATOR=Replicator
SET OK_SOFT_ALIAS_REMOTE_DESKTOP_USERS=Remote Desktop Users
SET OK_SOFT_ALIAS_NETWORK_CONFIGURATION_OPS=Network Configuration Operators
· the switch / cathedral users produces an output with some important domain accounts.
It is important to note that it concerns local domain accounts here. Thus
the domain is typically the computer name. The "domain name" and its SID
as additional information are spent. For example:
SET OK_SOFT_DOMAIN=OK03
SET OK_SOFT_DOMAIN_SID=S-1-5-21-1659004503-1547161642-839522115
SET OK_SOFT_USER_ADMIN=OK03\Administrator
SET OK_SOFT_USER_GUEST=OK03\Guest
Without / switch short and with the switch:
SET OK_SOFT_DOMAIN=OK03
SET OK_SOFT_DOMAIN_SID=S-1-5-21-1659004503-1547161642-839522115
SET OK_SOFT_USER_ADMIN=Administrator
SET OK_SOFT_USER_GUEST=Guest
· the switch / DomGroups produces an output with some important groups out
the local domain. Additionally, as with / cathedral users switches, become SID and that
"domain name" spent. On a workstation there are no local groups,
only on the server the switch supplies helpful information. Enclosed the example
of an output with / cathedral users switches on a workstation:
SET OK_SOFT_DOMAIN=OK03
SET OK_SOFT_DOMAIN_SID=S-1-5-21-1659004503-1547161642-839522115
SET OK_SOFT_GROUP_DOMAIN_USERS=OK03\None
Without / switch short and with the switch:
SET OK_SOFT_DOMAIN=OK03
SET OK_SOFT_DOMAIN_SID=S-1-5-21-1659004503-1547161642-839522115
SET OK_SOFT_GROUP_DOMAIN_USERS=None
· the switch / KnownNTGroups produces an output with some important waving
Known Windows NT groups. The name of the Built in domain becomes additional
spent. Enclosed two examples of the output of the LocNames.exe with that follow
Switch / KnownNTGroups and without as well as with / short switches:
SET OK_SOFT_KNOWN_GROUP_NT_AUTHORITY_DOMAIN=NT AUTHORITY
SET OK_SOFT_KNOWN_GROUP_NT_DIALUP=NT AUTHORITY\DIALUP
SET OK_SOFT_KNOWN_GROUP_NT_NETWORK=NT AUTHORITY\NETWORK
SET OK_SOFT_KNOWN_GROUP_NT_BATCH=NT AUTHORITY\BATCH
SET OK_SOFT_KNOWN_GROUP_NT_INTERACTIVE=NT AUTHORITY\INTERACTIVE
SET OK_SOFT_KNOWN_GROUP_NT_SERVICE=NT AUTHORITY\SERVICE
SET OK_SOFT_KNOWN_GROUP_NT_ANONYMOUS_LOGON=NT AUTHORITY\ANONYMOUS LOGON
SET OK_SOFT_KNOWN_GROUP_NT_PROXY=NT AUTHORITY\PROXY
SET OK_SOFT_KNOWN_GROUP_NT_ENTERPRISE_CONTROLLERS=NT AUTHORITY\ENTERPRISE DOMAIN
CONTROLLERS
SET OK_SOFT_KNOWN_GROUP_NT_PRINCIPAL_SELF=NT AUTHORITY\SELF
SET OK_SOFT_KNOWN_GROUP_NT_AUTHENTICATED_USER=NT AUTHORITY\Authenticated Users
SET OK_SOFT_KNOWN_GROUP_NT_RESTRICTED_CODE=NT AUTHORITY\RESTRICTED
SET OK_SOFT_KNOWN_GROUP_NT_TERMINAL_SERVER=NT AUTHORITY\TERMINAL SERVER USER
SET OK_SOFT_KNOWN_GROUP_NT_REMOTE_LOGON=NT AUTHORITY\REMOTE INTERACTIVE LOGON
SET OK_SOFT_KNOWN_GROUP_NT_LOCAL_SYSTEM=NT AUTHORITY\SYSTEM
SET OK_SOFT_KNOWN_GROUP_NT_LOCAL_SERVICE=NT AUTHORITY\LOCAL SERVICE
SET OK_SOFT_KNOWN_GROUP_NT_NETWORK_SERVICE=NT AUTHORITY\NETWORK SERVICE
SET OK_SOFT_KNOWN_GROUP_NT_BUILTIN_DOMAIN=BUILTIN
SET OK_SOFT_KNOWN_GROUP_NT_AUTHORITY_DOMAIN=NT AUTHORITY
SET OK_SOFT_KNOWN_GROUP_NT_DIALUP=DIALUP
SET OK_SOFT_KNOWN_GROUP_NT_NETWORK=NETWORK
SET OK_SOFT_KNOWN_GROUP_NT_BATCH=BATCH
SET OK_SOFT_KNOWN_GROUP_NT_INTERACTIVE=INTERACTIVE
SET OK_SOFT_KNOWN_GROUP_NT_SERVICE=SERVICE
SET OK_SOFT_KNOWN_GROUP_NT_ANONYMOUS_LOGON=ANONYMOUS LOGON
SET OK_SOFT_KNOWN_GROUP_NT_PROXY=PROXY
SET OK_SOFT_KNOWN_GROUP_NT_ENTERPRISE_CONTROLLERS=ENTERPRISE DOMAIN CONTROLLERS
SET OK_SOFT_KNOWN_GROUP_NT_PRINCIPAL_SELF=SELF
SET OK_SOFT_KNOWN_GROUP_NT_AUTHENTICATED_USER=Authenticated Users
SET OK_SOFT_KNOWN_GROUP_NT_RESTRICTED_CODE=RESTRICTED
SET OK_SOFT_KNOWN_GROUP_NT_TERMINAL_SERVER=TERMINAL SERVER USER
SET OK_SOFT_KNOWN_GROUP_NT_REMOTE_LOGON=REMOTE INTERACTIVE LOGON
SET OK_SOFT_KNOWN_GROUP_NT_LOCAL_SYSTEM=SYSTEM
SET OK_SOFT_KNOWN_GROUP_NT_LOCAL_SERVICE=LOCAL SERVICE
SET OK_SOFT_KNOWN_GROUP_NT_NETWORK_SERVICE=NETWORK SERVICE
SET OK_SOFT_KNOWN_GROUP_NT_BUILTIN_DOMAIN=BUILTIN
· the switch / short serves for switching the output into a short form without that
Domain Prefix.
· the switch / KnownGroups produces an output with the important wave Known
groups. For example:
SET OK_SOFT_KNOWN_GROUP_NULL=NULL SID
SET OK_SOFT_KNOWN_GROUP_EVERYONE=Everyone
SET OK_SOFT_KNOWN_GROUP_LOCAL=LOCAL
SET OK_SOFT_KNOWN_GROUP_CREATOR_OWNER=CREATOR OWNER
SET OK_SOFT_KNOWN_GROUP_CREATOR_GROUP=CREATOR GROUP
SET OK_SOFT_KNOWN_GROUP_CREATOR_OWNER_SERVER=CREATOR OWNER SERVER
SET OK_SOFT_KNOWN_GROUP_CREATOR_GROUP_SERVER=CREATOR GROUP SERVER
· the switch / all accounts is to equate with the switches / CommonDirs
/ DefUserDirs/CurrentUserDirs,
Switch for located listing names:
· the switch / CommonDirs produces an output with different
Listing names, which are user-independent. It knows SkipStdDirs with /
Switch to be combined, around the output of ALL USER PROFILES, ProgramFiles
to avoid and CommonProgramFiles. These three environment variables become
spent, in order to provide batch files, both on Windows the 2000/XP and
also on Windows NT 4,0 are executable, with those these three important
Environment variables are not available. Enclosed an example of the output follows
of LocNames.exe with / CommonDirs switch as well as that
/ SkipStdDirs switch:
SET OK_SOFT_COMMON_ACCESSORIES=C:\Documents and Settings\All Users\Start
Menu\Programs\Accessories
SET OK_SOFT_COMMON_GAMES=C:\Documents and Settings\All Users\Start Menu\Programs\Games
SET OK_SOFT_DEVICE_PATH=C:\WINDOWS\inf
SET OK_SOFT_MEDIA_PATH=C:\WINDOWS\Media
SET OK_SOFT_WALLPAPER_PATH=C:\WINDOWS\Web\Wallpaper
SET OK_SOFT_FONTS=C:\WINDOWS\Fonts
SET OK_SOFT_COMMON_STARTMENU=C:\Documents and Settings\All Users\Start Menu
SET OK_SOFT_COMMON_PROGRAMS=C:\Documents and Settings\All Users\Start Menu\Programs
SET OK_SOFT_COMMON_STARTUP=C:\Documents and Settings\All Users\Start Menu\Programs\Startup
SET OK_SOFT_COMMON_DESKTOPDIRECTORY=C:\Documents and Settings\All Users\Desktop
SET OK_SOFT_COMMON_FAVORITES=C:\Documents and Settings\All Users\Favorites
SET OK_SOFT_COMMON_APPDATA=C:\Documents and Settings\All Users\Application Data
SET OK_SOFT_COMMON_TEMPLATES=C:\Documents and Settings\All Users\Templates
SET OK_SOFT_COMMON_DOCUMENTS=C:\Documents and Settings\All Users\Documents
SET OK_SOFT_COMMON_ADMINTOOLS=C:\Documents and Settings\All Users\Start
Menu\Programs\Administrative Tools
SET OK_SOFT_COMMON_MUSIC=C:\Documents and Settings\All Users\Documents\My Music
SET OK_SOFT_COMMON_PICTURES=C:\Documents and Settings\All Users\Documents\My Pictures
SET OK_SOFT_COMMON_VIDEO=C:\Documents and Settings\All Users\Documents\My Videos
SET OK_SOFT_RESOURCES=C:\WINDOWS\resources
· the switch / CurrentUserDirs produces an output with different
Listing names, which are user-dependent. It knows SkipStdDirs with /
Switch to be combined, in order to avoid the output from APPDATA to. These three
Environment variables are spent, in order to provide such batch files, those
both on Windows 2000/XP and on Windows NT 4,0 are executable, with those
these three important environment variables are not available. It follows in
Example of the output of LocNames.exe with / CurrentUserDirs switch
together with / SkipStdDirs switch:
SET OK_SOFT_CURRENT_PROGRAMS=C:\Documents and Settings\Oleg.BONN\Start Menu\Programs
SET OK_SOFT_CURRENT_PERSONAL=C:\Documents and Settings\Oleg.BONN\My Documents
SET OK_SOFT_CURRENT_FAVORITES=C:\Documents and Settings\Oleg.BONN\Favorites
SET OK_SOFT_CURRENT_STARTUP=C:\Documents and Settings\Oleg.BONN\Start Menu\Programs\Startup
SET OK_SOFT_CURRENT_RECENT=C:\Documents and Settings\Oleg.BONN\Recent
SET OK_SOFT_CURRENT_SENDTO=C:\Documents and Settings\Oleg.BONN\SendTo
SET OK_SOFT_CURRENT_STARTMENU=C:\Documents and Settings\Oleg.BONN\Start Menu
SET OK_SOFT_CURRENT_MYMUSIC=C:\Documents and Settings\Oleg.BONN\My Documents\My Music
SET OK_SOFT_CURRENT_MYVIDEO=C:\Documents and Settings\Oleg.BONN\My Documents\My Videos
SET OK_SOFT_CURRENT_DESKTOPDIRECTORY=C:\Documents and Settings\Oleg.BONN\Desktop
SET OK_SOFT_CURRENT_NETHOOD=C:\Documents and Settings\Oleg.BONN\NetHood
SET OK_SOFT_CURRENT_TEMPLATES=C:\Documents and Settings\Oleg.BONN\Templates
SET OK_SOFT_CURRENT_PRINTHOOD=C:\Documents and Settings\Oleg.BONN\PrintHood
SET OK_SOFT_CURRENT_LOCAL_APPDATA=C:\Documents and Settings\Oleg.BONN\Local
Settings\Application Data
SET OK_SOFT_CURRENT_INTERNET_CACHE=C:\Documents and Settings\Oleg.BONN\Local
Settings\Temporary Internet Files
SET OK_SOFT_CURRENT_COOKIES=C:\Documents and Settings\Oleg.BONN\Cookies
SET OK_SOFT_CURRENT_HISTORY=C:\Documents and Settings\Oleg.BONN\Local Settings\History
SET OK_SOFT_CURRENT_MYPICTURES=C:\Documents and Settings\Oleg.BONN\My Documents\My Pictures
SET OK_SOFT_CURRENT_ADMINTOOLS=C:\Documents and Settings\Oleg.BONN\Start
Menu\Programs\Administrative Tools
SET OK_SOFT_CURRENT_CDBURN_AREA=C:\Documents and Settings\Oleg.BONN\Local
Settings\Application Data\Microsoft\CD Burning
SET OK_SOFT_CURRENT_ACCESSORIES=C:\Documents and Settings\Oleg.BONN\Start
Menu\Programs\Accessories
· one knows the switch / SkipStdDirs with the switches / CommonDirs and
/ CurrentUserDirs combine, around the output of APPDATA, ALL USER PROFILES,
To avoid ProgramFiles and CommonProgramFiles.
· the switch / DefUserDirs produces an output with different
Listing names, which are relevant for default user. Example:
SET OK_SOFT_DEFUSER_PROFILE=C:\Documents and Settings\Default User
SET OK_SOFT_DEFUSER_ADDDATA=C:\Documents and Settings\Default User\Application Data
SET OK_SOFT_DEFUSER_INTERNET_CACHE=C:\Documents and Settings\Default User\Local
Settings\Temporary Internet Files
SET OK_SOFT_DEFUSER_COOKIES=C:\Documents and Settings\Default User\Cookies
SET OK_SOFT_DEFUSER_DESKTOPDIRECTORY=C:\Documents and Settings\Default User\Desktop
SET OK_SOFT_DEFUSER_FAVORITES=C:\Documents and Settings\Default User\Favorites
SET OK_SOFT_DEFUSER_HISTORY=C:\Documents and Settings\Default User\Local Settings\History
SET OK_SOFT_DEFUSER_LOCAL_APPDATA=C:\Documents and Settings\Default User\Local
Settings\Application Data
SET OK_SOFT_DEFUSER_LOCAL_SETTINGS=C:\Documents and Settings\Default User\Local Settings
SET OK_SOFT_DEFUSER_NETHOOD=C:\Documents and Settings\Default User\NetHood
SET OK_SOFT_DEFUSER_PERSONAL=C:\Documents and Settings\Default User\My Documents
SET OK_SOFT_DEFUSER_PRINTHOOD=C:\Documents and Settings\Default User\PrintHood
SET OK_SOFT_DEFUSER_PROGRAMS=C:\Documents and Settings\Default User\Start Menu\Programs
SET OK_SOFT_DEFUSER_RECENT=C:\Documents and Settings\Default User\Recent
SET OK_SOFT_DEFUSER_SENDTO=C:\Documents and Settings\Default User\SendTo
SET OK_SOFT_DEFUSER_STARTMENU=C:\Documents and Settings\Default User\Start Menu
SET OK_SOFT_DEFUSER_STARTUP=C:\Documents and Settings\Default User\Start
Menu\Programs\Startup
SET OK_SOFT_DEFUSER_TEMPLATES=C:\Documents and Settings\Default User\Templates
· the switch / AllDirs is to equate with a combination / CommonDirs
/ DefUserDirs/CurrentUserDirs switch.
Switch for located listing names of different users, on that
Computers of user profiles have:
· the switch / logged user COUNT produces an output with the number of
User profiles, which are loaded by the operating system momentarily. On Windows XP
it is typically the number 4 or higher, since on the system services run, those
under local system, under local service and under network service run. If one
these special accounts not to take in account, can one wants / logged user COUNTS
Switch with / SkipLocalSystem, / SkipLocalService, / SkipNetworkService or
/ SkipAllSystem combine. An example of the output of LocNames.exe with that
/ logged user COUNT switch with / SkipAllSystem switches is combined:
SET OK_SOFT_LOGGED_USERS_COUNT=1
· the switch / you OF logged user: # produces an output with the listings of the
User number #, which is announced locally and loaded its profile. One can
this switch as well as / SkipLocalSystem, / SkipLocalService,
/ SkipNetworkService or / SkipAllSystem combine. An example:
SET OK_SOFT_LOGGED_USER_SID=S-1-5-21-1078081533-1580818891-1957994488-1135
SET OK_SOFT_LOGGED_USER_ADMINTOOLS=C:\Documents and Settings\Oleg.BONN\Start
Menu\Programs\Administrative Tools
SET OK_SOFT_LOGGED_USER_ADDDATA=C:\Documents and Settings\Oleg.BONN\Application Data
SET OK_SOFT_LOGGED_USER_INTERNET_CACHE=C:\Documents and Settings\Oleg.BONN\Local
Settings\Temporary Internet Files
SET OK_SOFT_LOGGED_USER_CDBURN_AREA=C:\Documents and Settings\Oleg.BONN\Local
Settings\Application Data\Microsoft\CD Burning
SET OK_SOFT_LOGGED_USER_COOKIES=C:\Documents and Settings\Oleg.BONN\Cookies
SET OK_SOFT_LOGGED_USER_DESKTOPDIRECTORY=C:\Documents and Settings\Oleg.BONN\Desktop
SET OK_SOFT_LOGGED_USER_FAVORITES=C:\Documents and Settings\Oleg.BONN\Favorites
SET OK_SOFT_LOGGED_USER_HISTORY=C:\Documents and Settings\Oleg.BONN\Local Settings\History
SET OK_SOFT_LOGGED_USER_LOCAL_APPDATA=C:\Documents and Settings\Oleg.BONN\Local
Settings\Application Data
SET OK_SOFT_LOGGED_USER_LOCAL_SETTINGS=C:\Documents and Settings\Oleg.BONN\Local Settings
SET OK_SOFT_LOGGED_USER_MYMUSIC=C:\Documents and Settings\Oleg.BONN\My Documents\My Music
SET OK_SOFT_LOGGED_USER_MYPICTURES=C:\Documents and Settings\Oleg.BONN\My Documents\My
Pictures
SET OK_SOFT_LOGGED_USER_MYVIDEO=C:\Documents and Settings\Oleg.BONN\My Documents\My Videos
SET OK_SOFT_LOGGED_USER_NETHOOD=C:\Documents and Settings\Oleg.BONN\NetHood
SET OK_SOFT_LOGGED_USER_PERSONAL=C:\Documents and Settings\Oleg.BONN\My Documents
SET OK_SOFT_LOGGED_USER_PRINTHOOD=C:\Documents and Settings\Oleg.BONN\PrintHood
SET OK_SOFT_LOGGED_USER_PROGRAMS=C:\Documents and Settings\Oleg.BONN\Start Menu\Programs
SET OK_SOFT_LOGGED_USER_RECENT=C:\Documents and Settings\Oleg.BONN\Recent
SET OK_SOFT_LOGGED_USER_SENDTO=C:\Documents and Settings\Oleg.BONN\SendTo
SET OK_SOFT_LOGGED_USER_STARTMENU=C:\Documents and Settings\Oleg.BONN\Start Menu
SET OK_SOFT_LOGGED_USER_STARTUP=C:\Documents and Settings\Oleg.BONN\Start
Menu\Programs\Startup
SET OK_SOFT_LOGGED_USER_TEMPLATES=C:\Documents and Settings\Oleg.BONN\Templates
· the switch / local user COUNT produces an output with the number of
User profiles, which are present on the computer. One knows this switch also
/ SkipLocalSystem, / SkipLocalService, / SkipNetworkService or / SkipAllSystem
and / SkipCentralProfiles combine. An example of the LocNames.exe output also
the switches / local user COUNTS and / SkipAllSystem:
SET OK_SOFT_LOCAL_USERS_COUNT=3
· the switch / you OF local user: # produces an output with listings of the
User number #, from the list of the users, who have a profile on
the computer. One knows this switch with / SkipLocalSystem, / SkipLocalService,
/ SkipNetworkService or / SkipAllSystem and / SkipCentralProfiles combine.
An example of the LocNames.exe output with switch / DirsOfLocalUser:1 together
with / SkipAllSystem:
SET OK_SOFT_LOCAL_USER_SID=S-1-5-21-1078081533-1580818891-1957994488-1135
SET OK_SOFT_LOCAL_USER_STATUS=ON
SET OK_SOFT_LOCAL_USER_ADMINTOOLS=C:\Documents and Settings\Oleg.BONN\Start
Menu\Programs\Administrative Tools
SET OK_SOFT_LOCAL_USER_ADDDATA=C:\Documents and Settings\Oleg.BONN\Application Data
SET OK_SOFT_LOCAL_USER_INTERNET_CACHE=C:\Documents and Settings\Oleg.BONN\Local
Settings\Temporary Internet Files
SET OK_SOFT_LOCAL_USER_CDBURN_AREA=C:\Documents and Settings\Oleg.BONN\Local
Settings\Application Data\Microsoft\CD Burning
SET OK_SOFT_LOCAL_USER_COOKIES=C:\Documents and Settings\Oleg.BONN\Cookies
SET OK_SOFT_LOCAL_USER_DESKTOPDIRECTORY=C:\Documents and Settings\Oleg.BONN\Desktop
SET OK_SOFT_LOCAL_USER_FAVORITES=C:\Documents and Settings\Oleg.BONN\Favorites
SET OK_SOFT_LOCAL_USER_HISTORY=C:\Documents and Settings\Oleg.BONN\Local Settings\History
SET OK_SOFT_LOCAL_USER_LOCAL_APPDATA=C:\Documents and Settings\Oleg.BONN\Local
Settings\Application Data
SET OK_SOFT_LOCAL_USER_LOCAL_SETTINGS=C:\Documents and Settings\Oleg.BONN\Local Settings
SET OK_SOFT_LOCAL_USER_MYMUSIC=C:\Documents and Settings\Oleg.BONN\My Documents\My Music
SET OK_SOFT_LOCAL_USER_MYPICTURES=C:\Documents and Settings\Oleg.BONN\My Documents\My
Pictures
SET OK_SOFT_LOCAL_USER_MYVIDEO=C:\Documents and Settings\Oleg.BONN\My Documents\My Videos
SET OK_SOFT_LOCAL_USER_NETHOOD=C:\Documents and Settings\Oleg.BONN\NetHood
SET OK_SOFT_LOCAL_USER_PERSONAL=C:\Documents and Settings\Oleg.BONN\My Documents
SET OK_SOFT_LOCAL_USER_PRINTHOOD=C:\Documents and Settings\Oleg.BONN\PrintHood
SET OK_SOFT_LOCAL_USER_PROGRAMS=C:\Documents and Settings\Oleg.BONN\Start Menu\Programs
SET OK_SOFT_LOCAL_USER_RECENT=C:\Documents and Settings\Oleg.BONN\Recent
SET OK_SOFT_LOCAL_USER_SENDTO=C:\Documents and Settings\Oleg.BONN\SendTo
SET OK_SOFT_LOCAL_USER_STARTMENU=C:\Documents and Settings\Oleg.BONN\Start Menu
SET OK_SOFT_LOCAL_USER_STARTUP=C:\Documents and Settings\Oleg.BONN\Start
Menu\Programs\Startup
SET OK_SOFT_LOCAL_USER_TEMPLATES=C:\Documents and Settings\Oleg.BONN\Templates
· the switch / SkipCentralProfiles knows local user COUNTS in combination with /
or / you OF local user: # Switches to be used, around users with central
To omit profiles.
· the switch / SkipLocalSystem knows logged user COUNTS in combination with /,
/ local user COUNTS, / you OF logged user: # or / you OF local user: # Switches
are used, in order to omit users with central profiles.
· the switch / SkipLocalService knows logged user COUNTS in combination with /,
/ local user COUNTS, / you OF logged user: # or / you OF local user: # Switches
are used, in order to omit users with local system.
· the switch / SkipNetworkService can do in combination with that
/ logged user COUNTS, / local user COUNTS, / you OF logged user: # or
/ you OF local user: # Switches to be used, around users with network service
to omit.
· the switch/SkipAllSystem is the same, as the combination of
/ SkipLocalSystem, / SkipLocalService and / SkipNetworkService.
Two general switches
· the switch / all is the same as / AllDirs as well as / all accounts
Switch.
· the switch / DELETE universe lists all to time set environment variables with that
Prefix OK_SOFT _ up. The output does not contain anything behind the equal character. Thus
one can remove all by LocNames.exe for set environment variables
before.
Example 1:
In the following example one has a Setup, which adds a program in
the autostarting menu. That is not desired. The Setup does not offer a possibility of switching it off.
Beyond that in tests it turned out that each user of write rights for one
File from the program directory needs.
By LocNames.exe both problems are solved. Become after the start of
Original Setup by the call of among other things two environment variables
determined: %OK_SOFT_COMMON_STARTUP%, which the autostarting menu listing
represent, and %OK_SOFT_ALIAS_USERS%, which has the name of the local user group.
The following batch file shows excluding only the work with the LocNames.exe utility.
@echo off
setup.exe /s
set exitCode=%ERRORLEVEL%
REM
REM setup create SomeProgram.lnk in Startup menu and for the file
REM "%ProgramFiles%\Some Company\Some Product\ConfigForAll.dat"
REM User needs read/write permission.
REM We solve the programs with respect of LocNames.exe and cacls.exe
REM
LocNames.exe /alias /CommonDirs >%TEMP%\t.cmd
call %TEMP%\t.cmd
if exist "%ProgramFiles%\Some Company\Some Product\ConfigForAll.dat"
"%SystemRoot%\system32\cacls.exe" "%ProgramFiles%\Some Company\Some
Product\ConfigForAll.dat" /E /P %OK_SOFT_ALIAS_USERS%:C >nul
if exist "%OK_SOFT_COMMON_STARTUP%\SomeProgram.lnk" del
"%OK_SOFT_COMMON_STARTUP%\SomeProgram.lnk"
LocNames.exe /DeleteAll >%TEMP%\t.cmd
call %TEMP%\t.cmd
del %TEMP%\t.cmd
exit /b %exitCode%
It is very important that the batch file returns the delivery the same ERROR LEVEL, like
the original Setup. It makes the examination possible of the success of the installation procedure. But is
the ERROR LEVEL of the Setups into the exit code environment variable stored and becomes to
End of the batch file over the EXIT instruction as result passed on.
Example 2:
In the next example one shows, how LocNames.exe be used can, around those
To extend border of kind of snapping.
In the example a program product is installed, which one for all users as very much
importantly classifies. In the enterprise the border of kind of snapping is used. All users are
it accustoms that they find all important applications in the border of kind of snapping. Thus all
Users, who do not have a central profile, after the software installation the linkage
for the start of the new software on its border of kind of snapping, becomes this linkage finds
both and in default user profile copies into all profiles, those at the installation time on that
Computers are present.
@echo off
setup.exe /s
LocNames.exe /DefUserDirs >%TEMP%\t.cmd
call %TEMP%\t.cmd
if not exist "%OK_SOFT_DEFUSER_APPDATA%\Microsoft\Internet Explorer\Quick Launch" md
"%OK_SOFT_DEFUSER_APPDATA%\Microsoft\Internet Explorer\Quick Launch"
copy "New Program.lnk" "%OK_SOFT_DEFUSER_APPDATA%\Microsoft\Internet Explorer\Quick
Launch\" >nul
LocNames.exe /LocalUsersCount /SkipCentralProfiles /SkipAllSystem >%TEMP%\t.cmd
call %TEMP%\t.cmd
for /L %%i in (1,1,%OK_SOFT_LOCAL_USERS_COUNT%) do call :CopyShortcut %%i
LocNames.exe /DeleteAll >%TEMP%\t.cmd
call %TEMP%\t.cmd
del %TEMP%\t.cmd
goto :EOF
:CopyShortcut
REM First of all deletes old value of environment variable used in
REM the block. In the batch file it's enough to clear old value of
REM OK_SOFT_LOCAL_USER_ADDDATA for example, with
REM SET OK_SOFT_LOCAL_USER_ADDDATA=
REM Alternatively, one can delete here all environment variables,
REM which begin with OK_SOFT_ prefix. In the case be sure, that you
REM don't use any OK_SOFT_* variable in lines after
REM call :CopyShortcut (after for /L ...). Otherwise set needed
REM variables one more time
REM
LocNames.exe /DeleteAll >%TEMP%\t.cmd
call %TEMP%\t.cmd
LocNames.exe /DirsOfLocalUser:%1 /SkipCentralProfiles /SkipAllSystem >%TEMP%\t.cmd
call %TEMP%\t.cmd
if "%OK_SOFT_LOCAL_USER_ADDDATA%" == "" goto :EOF
if not exist "%OK_SOFT_LOCAL_USER_ADDDATA%\Microsoft\Internet Explorer\Quick Launch" md
Note:
The instruction EXIT with parameter becomes only starting from Windows 2000
supported. If the batch file also under Windows NT 4,0 to
Employment to come should, is instead of EXIT e.g. SetError.exe utility
are used.
"%OK_SOFT_LOCAL_USER_ADDDATA%\Microsoft\Internet Explorer\Quick Launch"
copy "New Program.lnk" "%OK_SOFT_LOCAL_USER_ADDDATA%\Microsoft\Internet Explorer\Quick
Launch\" >nul
After the start of the original Setups LocNames.exe becomes as the first with the switch
/ DefUserDirs started. The paths are determined to different listings,
for default the user are relevant. Among other things is
%OK_SOFT_DEFUSER_APPDATA%. It has normally the value C:\Documents
and Settings\Default User\Application DATA and/or. C:\Dokumente and
Einstellungen\Default User\Anwendungsdaten.
Next a linkage becomes into the sublist in the batch file
Microsoft\Internet Explorer\Quick Launch of this listing copies. As required
the appropriate listing is again provided:
:
if not exist "%OK_SOFT_DEFUSER_APPDATA%\Microsoft\Internet Explorer\Quick Launch" md
"%OK_SOFT_DEFUSER_APPDATA%\Microsoft\Internet Explorer\Quick Launch"
copy "New Program.lnk" "%OK_SOFT_DEFUSER_APPDATA%\Microsoft\Internet Explorer\Quick
Launch\" >nul
:
The number of users is continued to determine, who have a profile on the computer.
User with the central profile and all system accounts (local system, local service and
Network service) are not taken in account thereby:
LocNames.exe/local user COUNT/SkipCentralProfiles/SkipAllSystem>%TEMP%\t.cmd
call %TEMP%\t.cmd
Afterwards the copy stronghold CUT routine in a FOR loop is several times called, once
per profile:
for/L %%i in (1,1,%OK_SOFT_LOCAL_USERS_COUNT%) DO call :CopyShortcut %%i
The parameter %%i becomes the values 1 to %OK_SOFT_LOCAL_USERS_COUNT% thereby also
the step 1 go through. In the copy stronghold CUT routine is addressed the parameter as
%1.
In the copy stronghold CUT routine as the first all values of the earlier call are deleted:
LocNames.exe/DELETE universe > %TEMP%\t.cmd
call %TEMP%\t.cmd
Afterwards become with the call
LocNames.exe/DirsOfLocalUser:%1/SkipCentralProfiles/SkipAllSystem > %TEMP%\t.cmd
call %TEMP%\t.cmd
the new values for the %OK_SOFT_LOCAL_USER_XXX% environment variables set, among other things.
the value for %OK_SOFT_LOCAL_USER_ADDDATA%.
In the end "new Program.lnk " becomes in
"Explorer\Quick Launch %OK_SOFT_DEFUSER_APPDATA%\Microsoft\Internet \"
Listing copies:
if not exist "%OK_SOFT_LOCAL_USER_ADDDATA%\Microsoft\Internet Explorer\Quick Launch" md
"%OK_SOFT_LOCAL_USER_ADDDATA%\Microsoft\Internet Explorer\Quick Launch"
copy "New Program.lnk" "%OK_SOFT_LOCAL_USER_ADDDATA%\Microsoft\Internet Explorer\Quick
Launch\" >nul
Go to Help Contents
|