Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Windows Installation directory from DOS
Message
 
To
07/07/2000 10:20:35
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00389463
Message ID:
00389482
Views:
17
>I would like to know the Windows installation directory so that I can place Desktop icons ( Shortcuts ) in \Desktop directory. What file should I search for which gives me the Windows installation directory.
>
>Also note that I have to find using DOS commands
>
Rakesh,

The desktop directory may be different from computer to computer, and, in the case of multiple users, may be different within the computer. Unfortunately, there are no DOS commands that can retrieve this information. The closest you can come is the Windows Script Host. The WSH can run be run from DOS via the cscript.exe program. The WSH is freely downloadable and re-distributable and is available from the MS site. The following snippet, in VBScript will retrieve the desktop directory:
' Desktop.vbs
' To run from DOS issue cscript.exe desktop.vbs from the command prompt
Dim cDesktop, oShell
Set oShell = CreateObject("WScript.Shell")
cDesktop = oShell.SpecialFolders.Item("Desktop")
MsgBox cDesktop
BTW, is there any special reason why this has to be done from DOS?
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform