Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Windows Installation directory from DOS
Message
 
À
07/07/2000 10:20:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00389463
Message ID:
00389482
Vues:
16
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform