jerseyzuks Posted June 21, 2012 Share Posted June 21, 2012 DirCreate (@MyDocumentsDir & "\TestFolder") Works fine on my machine (the computer I am writing the script from), but it doesn't create the "test folder" on everyone else's machine. All the users can create the folder manually, so it isn't a read/write permissions issue. Both my computer, and the end users computers are all Win 7 machines. UAC prompt does come up when the script is run, and an admin ID is entered. Users are logged on to their own machines with their own IDs (non-admin) Am I missing something really silly? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 21, 2012 Moderators Share Posted June 21, 2012 Hi, jerseyzuks. Just to confirm, you mention you're entering an Admin ID. Does this mean you're doing a RunAs at some point. Or are you just adding #RequireAdmin at the top? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
jerseyzuks Posted June 21, 2012 Author Share Posted June 21, 2012 Hi, jerseyzuks. Just to confirm, you mention you're entering an Admin ID. Does this mean you're doing a RunAs at some point. Or are you just adding #RequireAdmin at the top?There is a #RequireAdmin at the top, but the users need to enter an admin ID for the User Access Control window when launching the script Link to comment Share on other sites More sharing options...
zorphnog Posted June 21, 2012 Share Posted June 21, 2012 If you are requiring that an Admin run it, then the script is running in the context of the admin user supplied to UAC. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 21, 2012 Moderators Share Posted June 21, 2012 (edited) I'm assuming you are an admin. Does it work for you on one of their computers? I think you end up running it as the Admin account.Edit: zorphnog beat me to the punch Edited June 21, 2012 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
jerseyzuks Posted June 21, 2012 Author Share Posted June 21, 2012 If you are requiring that an Admin run it, then the script is running in the context of the admin user supplied to UAC.but the next line of code is ShellExecute (@MyDocumentsDir)and it opens the users mydocuments folder Link to comment Share on other sites More sharing options...
jerseyzuks Posted June 21, 2012 Author Share Posted June 21, 2012 I'm assuming you are an admin. Does it work for you on one of their computers? I think you end up running it as the Admin account.Edit: zorphnog beat me to the punch Yes. If I log on to windows with my ID, and enter my ID into the UAC... the script works just fine Link to comment Share on other sites More sharing options...
zorphnog Posted June 21, 2012 Share Posted June 21, 2012 (edited) Reading (i.e. opening the directory) is different than writing. Creating a directory would require write permissions (usually not granted to admins by default for a user's personal folder), but if you are running with UAC your permissions set is that of the administrator. Edit: Does the DirCreate function return 1 or 0? Edited June 21, 2012 by zorphnog Link to comment Share on other sites More sharing options...
jerseyzuks Posted June 21, 2012 Author Share Posted June 21, 2012 well, it is absolutely UAC's fault. Directory was being created in the profile of the admin (I didn't see it before, because the script deletes the folder at the end) Thanks for the help guys, back to the drawing board 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