MSFN Forum: Desktop environment variable - MSFN Forum

Jump to content



Unattended CD/DVD Guide Homepage · MSFN Forum Rules

If you have questions about customizing Windows XP that are nLite-specific, please post them in the nLite forum, not here. If you have questions regarding the unattended installation of Windows XP, please post them in the Unattended Windows 2000/XP/2003 section.
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Desktop environment variable Rate Topic: -----

#1 User is offline   0v3rload 

  • Group: Members
  • Posts: 5
  • Joined: 12-March 08

  Posted 12 March 2008 - 11:44 AM

I will be dealing shortly with a simple CLI installer and need to create a shortcut on the user's desktop. Trouble is the desktop is only called "Desktop" in the english version and has other language-specific names in non-english versions (ie. Portuguese: "Ambiente de Trabalho".)

So, what I would like to know is if there is a way of retrieving the path to the user's desktop using only XP's shell?

%USERPROFILE%\<desktop_string>

Many thanks.


#2 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,195
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 12 March 2008 - 12:02 PM

It depends on your interpretation of XP's shell; if you mean without third party utilities then yes it can be retrieved.

#3 User is offline   0v3rload 

  • Group: Members
  • Posts: 5
  • Joined: 12-March 08

Posted 12 March 2008 - 07:53 PM

View PostYzöwl, on Mar 12 2008, 06:02 PM, said:

It depends on your interpretation of XP's shell; if you mean without third party utilities then yes it can be retrieved.


How? I'm using XP's standard command prompt (not PowerShell.)

#4 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,019
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 12 March 2008 - 09:32 PM

View Post0v3rload, on Mar 13 2008, 03:53 AM, said:

View PostYzöwl, on Mar 12 2008, 06:02 PM, said:

It depends on your interpretation of XP's shell; if you mean without third party utilities then yes it can be retrieved.


How? I'm using XP's standard command prompt (not PowerShell.)


Try this vbs script it has 2 examples of how to get the desktop path.
Save As DesktopPath.vbs

Quote

Const DESKTOP = &H10& 
Dim Act:Set Act = CreateObject("Wscript.Shell")
Dim Dtop, DT, Shell
Set Shell = CreateObject("Shell.Application")
Set Dtop = Shell.Namespace(DESKTOP)
Set DT = Dtop.Self

WScript.Echo Act.SpecialFolders("Desktop")  & vbCrLf & DT.Path


#5 User is offline   0v3rload 

  • Group: Members
  • Posts: 5
  • Joined: 12-March 08

Posted 13 March 2008 - 12:07 PM

Thanks for that!

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy