environmental variable

G

Guest

Guest
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
 

GTS

Distinguished
Aug 24, 2003
520
0
18,980
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
 
G

Guest

Guest
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
>
>
>
 

GTS

Distinguished
Aug 24, 2003
520
0
18,980
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
>
>
 
G

Guest

Guest
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/archives/_comment/001075.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
 
G

Guest

Guest
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/scriptcenter/default.mspx