Sign in to follow this  
Followers 0
DavidDuanne

@DesktopCommonDir macro not working on Windows 7??

7 posts in this topic

I created a script that, along with other things, creates a shortcut on the desktop.  The shortcut MUST be created in the "Public Desktop" folder on Windows 7 computers and the "All UsersDesktop" folder on XP computers.  I need for all users to get the shortcut.  

Rather than using IF/THEN statements to figure out the OS version then copying the file to a different path based on the version, I attempted to use the @DesktopCommonDir macro; which is supposed to figure this out for me.

The @DesktopCommonDir keeps returning an incorrect path on Windows 7 computers (only).  XP was okay.

I wrote a quick test script with the following line:

msgbox(0,"title",@DesktopCommonDir)

On a Windows 7 computer, the test script returns this path: "C:UsersPublicDesktop".  Unfortunately, that is not the correct path.  The correct path to the public desktop is "C:UsersPublicPublic Desktop".

I've looked at 3 different Windows 7 computers to make sure.  I also ran the test script on those computers.  Each time, I get the incorrect path.

Am I using the macro correctly?  Or did I find a bug undocumented feature?

Share this post


Link to post
Share on other sites



The correct path is "C:UsersPublicDesktop" as @DesktopCommonDir is returning.  To see the path, go the directory in Windows Explorer, and then click on the Address Bar.  It will show the path as "C:UsersPublicDesktop".

 

Adam

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

My (well, not mine actually, but the one I use) laptop is running Windows 7 HP, and this is what Explorer is showing me - http://prntscr.com/3713m5, exactly what is posted above.

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

Win8 here and its returning the same/correct path, C:UsersPublicDesktop

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I realize that it has been some time since the op posted the original question, but it is generally a matter of needing administrative rights when the script is run. Standard users are stopped by a UAC prompt to create files in these locations, so your script will need to do the same. If it is a compiled script, right click and run as administrator, or add: #RequireAdmin. YMMV. This may have nothing at all to do with your issue.

Edited by KenE

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I realize that it has been some time since the op posted the original question, but it is generally a matter of needing administrative rights when the script is run. Standard users are stopped by a UAC prompt to create files in these locations, so your script will need to do the same. If it is a compiled script, right click and run as administrator, or add: #RequireAdmin. YMMV. This may have nothing at all to do with your issue.

 

Thanks for necromancing the thread :) OP wanted, or rather expected, a non-standard location returned from his for his public desktop ("C:UsersPublicPublic Desktop" instead of "C:UsersPublicDesktop"). Apparently his Windows was set to the default setting. It was probably a simple misunderstanding on OP's side. So it has indeed little or nothing to do with the OP's post...

Also, OP posted a grand total of 1 messages on the forum, so the chances that he is still interested require at least a double precision float to express.

Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0