simbo Posted June 23, 2009 Share Posted June 23, 2009 Hi All. One of my scripts creates a shortcut to itself in the user's startup directory like this:- FileCreateShortcut(@ScriptFullPath, @StartupDir & "\myprog.lnk") This works fine. When I try and create a similar shortcut in the common startup directory like this... FileCreateShortcut(@ScriptFullPath, @StartupCommonDir & "\myprog.lnk") It returns zero and doesn't work. I assume Vista is blocking it because if I try and do it manually I get "Destination Folder Access Denied", have to click Continue and then User Account Control asked me to click continue as well. (Why do I have to tell them twice?! But that's another issue). Windows doens't throw any error messages or prompts when I run my script, it just doesn't work. I can't just turn off UAC because it will be used on other people's machines as well. Can I do something with the optional arguments when using FileCreateShortcut? to give the command Admin priviledges or something? Thanks in advance Simbo Link to comment Share on other sites More sharing options...
LurchMan Posted June 23, 2009 Share Posted June 23, 2009 Hi All.One of my scripts creates a shortcut to itself in the user's startup directory like this:-FileCreateShortcut(@ScriptFullPath, @StartupDir & "\myprog.lnk")This works fine.When I try and create a similar shortcut in the common startup directory like this...FileCreateShortcut(@ScriptFullPath, @StartupCommonDir & "\myprog.lnk")It returns zero and doesn't work.I assume Vista is blocking it because if I try and do it manually I get "Destination Folder Access Denied", have to click Continue and then User Account Control asked me to click continue as well. (Why do I have to tell them twice?! But that's another issue). Windows doens't throw any error messages or prompts when I run my script, it just doesn't work.I can't just turn off UAC because it will be used on other people's machines as well.Can I do something with the optional arguments when using FileCreateShortcut? to give the command Admin priviledges or something?Thanks in advanceSimboWhy don't you just create a registry key for startup for the script (if its compiled). Not sure where its at in vista search google to find it. Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
simbo Posted June 23, 2009 Author Share Posted June 23, 2009 Why don't you just create a registry key for startup for the script (if its compiled). Not sure where its at in vista search google to find it.Thanks LurchMan,I had initially rejected that because some anti-vrius programs seem to notice my scripts fiddling with the registry and give my users scary sounding error messages, but I may well have to unless someone else has a way around the UAC?Regards,Matt Link to comment Share on other sites More sharing options...
LurchMan Posted June 23, 2009 Share Posted June 23, 2009 thats vistas wonderful security that everyone loves so much. In XP i can edit reg info without AV even caring (which can be good and bad ) Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
GodlessSinner Posted June 23, 2009 Share Posted June 23, 2009 #requireadmin FileCreateShortcut(@ScriptFullPath, @StartupCommonDir & "\myprog.lnk") It's works. _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
simbo Posted June 24, 2009 Author Share Posted June 24, 2009 #requireadmin FileCreateShortcut(@ScriptFullPath, @StartupCommonDir & "\myprog.lnk") It's works. I've just given it a try and it makes UAC appear every time. With Vista even Admins have to click continue to make system changes. I think I shall have to use the registry, unless I'm missing something? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now