environmental variable

Forum Windows XP : Windows XP General Discussion - environmental variable

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

Archived from groups: microsoft.public.windowsxp.general (More info?)

 

Does anybody know the environmental variable for the files system directories
to get the path of: C:\Documents and Settings\username\Start Menu\Programs.

This typical path is good for Windows engl version, but the folders have
different names in a french or polish version. Therefore I am looking for a
shell script or environmental variable or a Constant to be used in different
language versions of Windows.

Can anybody give an input ?
thanks
Friedi

Sponsored Links
Register or log in to remove.
- 0 +

Archived from groups: microsoft.public.windowsxp.general (More info?)

 

%ProgramFiles% I don't know if this would be the same in non-English
versions though.
BTW, you should not assume a C drive letter for English versions.
--

"Friedi" <Friedi@Friedi.com> wrote in message
news:42DA451C-40E1-43F4-A492-7F3323614AD7@microsoft.com...
> Does anybody know the environmental variable for the files system
> directories
> to get the path of: C:\Documents and Settings\username\Start
> Menu\Programs.
>
> This typical path is good for Windows engl version, but the folders have
> different names in a french or polish version. Therefore I am looking for
> a
> shell script or environmental variable or a Constant to be used in
> different
> language versions of Windows.
>
> Can anybody give an input ?
> thanks
> Friedi

Reply to GTS

Archived from groups: microsoft.public.windowsxp.general (More info?)

 

There isn't one. One normally asks windows what is the file path using ShGetSpecialFolder or varients.

--
--------------------------------------------------------------------------------------------------
http://webdiary.smh.com.au/archive [...] 01075.html
=================================================
"Friedi" <Friedi@Friedi.com> wrote in message news:42DA451C-40E1-43F4-A492-7F3323614AD7@microsoft.com...
> Does anybody know the environmental variable for the files system directories
> to get the path of: C:\Documents and Settings\username\Start Menu\Programs.
>
> This typical path is good for Windows engl version, but the folders have
> different names in a french or polish version. Therefore I am looking for a
> shell script or environmental variable or a Constant to be used in different
> language versions of Windows.
>
> Can anybody give an input ?
> thanks
> Friedi

Reply to Anonymous
- 0 +

Archived from groups: microsoft.public.windowsxp.general (More info?)

 

Correction - I misread your post. I see you want user programs not all
users. FWIW, In English Windows that would be
"%HOMEDRIVE%%HOMEPATH%\Start Menu\Programs"
--

"GTS" <x> wrote in message news:%23tHtp$0cFHA.4040@TK2MSFTNGP14.phx.gbl...
> %ProgramFiles% I don't know if this would be the same in non-English
> versions though.
> BTW, you should not assume a C drive letter for English versions.
> --
>
> "Friedi" <Friedi@Friedi.com> wrote in message
> news:42DA451C-40E1-43F4-A492-7F3323614AD7@microsoft.com...
>> Does anybody know the environmental variable for the files system
>> directories
>> to get the path of: C:\Documents and Settings\username\Start
>> Menu\Programs.
>>
>> This typical path is good for Windows engl version, but the folders have
>> different names in a french or polish version. Therefore I am looking
>> for a
>> shell script or environmental variable or a Constant to be used in
>> different
>> language versions of Windows.
>>
>> Can anybody give an input ?
>> thanks
>> Friedi
>
>

Reply to GTS

Archived from groups: microsoft.public.windowsxp.general (More info?)

 

Thanks for your answer, but I need the path for \Start Menu\Programs.
In the polish version of windows this would be \Menu Start\Programy
In the french version, it would be different too - so I am looking for a
constante or variable to give me the path to \Start Menu\Programs for any
language version.
--
Friedi


"GTS" wrote:

> %ProgramFiles% I don't know if this would be the same in non-English
> versions though.
> BTW, you should not assume a C drive letter for English versions.
> --
>
> "Friedi" <Friedi@Friedi.com> wrote in message
> news:42DA451C-40E1-43F4-A492-7F3323614AD7@microsoft.com...
> > Does anybody know the environmental variable for the files system
> > directories
> > to get the path of: C:\Documents and Settings\username\Start
> > Menu\Programs.
> >
> > This typical path is good for Windows engl version, but the folders have
> > different names in a french or polish version. Therefore I am looking for
> > a
> > shell script or environmental variable or a Constant to be used in
> > different
> > language versions of Windows.
> >
> > Can anybody give an input ?
> > thanks
> > Friedi
>
>
>

Reply to Anonymous

Archived from groups: microsoft.public.windowsxp.general (More info?)

 

Friedi wrote:

> Does anybody know the environmental variable for the files
> system directories to get the path of: C:\Documents and
> Settings\username\Start Menu\Programs.
>
> This typical path is good for Windows engl version, but the
> folders have different names in a french or polish version.
> Therefore I am looking for a shell script or environmental
> variable or a Constant to be used in different language
> versions of Windows.
>
> Can anybody give an input ?
Hi,

Read out the data in the registry value "Programs" under
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
\Shell Folders\


As long as you haven't redirected the user profile folder away from
the system drive, this batch file that uses reg.exe (that comes
builtin with WinXP) should work for you:

--------------------8<----------------------
@echo off
setlocal
set rkey="HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
set rvalue="Programs"
set regexe=%SystemRoot%\System32\Reg.exe
:: line above for command (line might wrap)
for /f "Skip=4 Tokens=2 Delims=:" %%a in ('%regexe% QUERY %rkey% /v %rvalue%') do set rdata=%%a
:: line under for command
set ProgramsMenu=%SystemDrive%%rdata%

echo %ProgramsMenu%

pause
endlocal
--------------------8<----------------------



If you have redirected the user profile, or you need to support
Windows 2000 computers as well, use this batch file that creates a
VBScript on the fly that obtains the value:

--------------------8<----------------------
@echo off
setlocal
set tmpfile="%tmp%\pp.vbs"
echo Set oSh = CreateObject("WScript.Shell" ) >%tmpfile%
echo WScript.Echo oSh.RegRead("HKCU\Software\Microsoft\" _ >>%tmpfile%
echo ^& "Windows\CurrentVersion\Explorer\Shell Folders\Programs" ) >>%tmpfile%

for /f "tokens=*" %%a in (
'cscript.exe //Nologo %tmpfile%') do set ProgramsMenu=%%a
del %tmpfile%

echo %ProgramsMenu%

pause
endlocal
--------------------8<----------------------


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/s [...] fault.mspx

Reply to Anonymous
Tom's Hardware > Forum > Windows XP > Windows XP General Discussion > environmental variable
Go to:

There are 728 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them