Page 1 of 1 1
Topic Options
#213235 - 2018-03-13 12:14 PM Question about variable for Desktop
mmuser Offline
Fresh Scripter

Registered: 2010-05-10
Posts: 13
Loc: Germany
Hi,
we use 4.67. I'm not a goot programmer and i dont unterstand something at kixtart.
We need a variable for the desktop.

I use the following:
 Code:
;$rc = SetOption("NoVarsInStrings", "On")
$Desktop = ExpandEnvironmentVars(%USERPROFILE%)
$Desktop = $Desktop + "\Desktop"

If i "deactivate" $rc = SetOption("NoVarsInStrings", "On")
i get the value in $Desktop


But i'm not sure if the following commands runs:

copy "\\serv01\profile\lokal\%username%.v2\Desktop" "I:\Desktop\" or:

SHELL "CMD.EXE /C %logonserver%\netlogon\IE_Druck.bat"

Kind Regards
Christian


Edited by Mart (2018-03-13 02:52 PM)
Edit Reason: Added code tags.

Top
#213238 - 2018-03-14 10:20 AM Re: Question about variable for Desktop [Re: mmuser]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1865
Loc: Hilversum, The Netherlands
It is much safer to look up the path of the Desktop in the registry.
In case of redirected folders, profile problems etc. this is the safest bet.
 Code:
$Desktop=ReadValue("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","Desktop")

Top
#213240 - 2018-03-14 12:37 PM Re: Question about variable for Desktop [Re: Arend_]
mmuser Offline
Fresh Scripter

Registered: 2010-05-10
Posts: 13
Loc: Germany
If i use the solution with the readvalue i get at an windows 7 pc the value %userprofile%\Desktop - %userprofile% would not been resolved
Top
#213241 - 2018-03-15 09:56 AM Re: Question about variable for Desktop [Re: mmuser]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1865
Loc: Hilversum, The Netherlands
Then use this:
 Code:
$Desktop=ExpandEnvironmentVars(ReadValue("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","Desktop"))

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 35 anonymous users online.
Newest Members
thequeen, ameliaryan, shalomsalami, dkdssdk, Vroon
17639 Registered Users

Generated in 0.029 seconds in which 0.01 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org