Jump to content

Recommended Posts

Posted

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?

  • Moderators
Posted

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!

Posted

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

  • Moderators
Posted (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 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!

Posted

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

Posted

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

Posted (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 by zorphnog
Posted

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...