Message 1 of 6
Get User Desktop Path
Not applicable
10-28-2010
04:04 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need the string path to the all users desktop and wrote 2 functions which I test only under XP where works well, and need test assistance just know if those functions return the correct desktop path in other Windows versions, especially in Vista and 7.
No need to post the actual string that the functions return (this is a private info), I wish just to confirm if they works correct and on which Windows version you tested.
Thank in advance for your assistance!
Anubis
Some characters replaced by post form... attachment not works too (right now?)
Download link to the script file:
http://narod.ru/disk/26702278000/getDesktopPath.ms.html
No need to post the actual string that the functions return (this is a private info), I wish just to confirm if they works correct and on which Windows version you tested.
Thank in advance for your assistance!
Anubis
-- TEST #1 --// Max 9 +
fn getDesktopPath_FN1 = (
env = dotNetClass "System.Environment"
env.ExpandEnvironmentVariables(@"
L;LUSERSPROFILE%\Desktop")
)
desk1 = getDesktopPath_FN1()
-- TEST #2 --// Max 2008 + (or AVG for older)
desk2 = ""
if HiddenDOSCommand != undefined then
(
fn getDesktopPath_FN2 = (
tmpFile = (GetDir #temp + "\\dos.txt")
SysDrive = (sysInfo.windowsdir) +":\\"
cmd = "echo 
L;LUSERSPROFILE%\Desktop>\"" + tmpFile + "\""
HiddenDOSCommand cmd startpath:SysDrive
f = openFile tmpFile mode:"r"
desk = ReadLine f ; close f
deleteFile (GetDir #temp + "\\dos.txt")
desk
)
desk2 = getDesktopPath_FN2()
)
else (messageBox "This script function required AVG!" title:"Woops...")
clearListener()
format "FN(1) result = %\nFN(2) result = %\n" desk1 desk2
/*
Expected result for public Desktop should be:
XP or earlier : "C:\Documents and Settings\All Users\Desktop"
Vista or later: "C:\Users\Public\Desktop"
*/
-- Optional -- uncomment next 2 lines and test one-by-one:
--ShellLaunch desk1 ""
--ShellLaunch desk2 ""
Some characters replaced by post form... attachment not works too (right now?)
Download link to the script file:
http://narod.ru/disk/26702278000/getDesktopPath.ms.html
