Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Detect Default Document Folder

1 view
Skip to first unread message

Bob

unread,
Sep 9, 2001, 2:10:15 PM9/9/01
to
Is there a way to get the system default for data, Word, Excel etc. I will
be running a batch file on Windows NT and 2000.

I could do IF EXIST but I thought I would first check to see if someone
knows how to get the actual default location.

Thanks,
Bob

If you reply to me please remove ATHOME from my address


Frank-Peter Schultze

unread,
Sep 16, 2001, 2:57:06 PM9/16/01
to
"Bob" <BobAske...@home.com> schrieb im Newsbeitrag news:bgOm7.57147$MK5.31...@news1.sttln1.wa.home.com...

> Is there a way to get the system default for data, Word, Excel etc. I will
> be running a batch file on Windows NT and 2000.
>
> I could do IF EXIST but I thought I would first check to see if someone
> knows how to get the actual default location.

This requires REG.EXE (from the Windows 2000 Support Tools or Windows
NT4 Resource Kit):

:: Set DocFolder variable to the common document folder
Set RootKey=HKLM
Set SubKey=SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
Set ValueName=Common Documents
For /F "Tokens=2* Delims= " %%A in (
'Reg Query "%RootKey%\%SubKey%" /v "%ValueName%" ^| Find /I "%ValueName%"'
) Do (Set DocFolder=%%B)

--
Frank-Peter Schultze <fpsch...@my-deja.com>, http://www.fpschultze.de

0 new messages