Jump to content

What is wrong with this line of code?


Recommended Posts

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

  • Moderators

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

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

  • Moderators

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!

Link to comment
Share on other sites

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

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
Link to comment
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
 Share

  • Recently Browsing   0 members

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