tonycst Posted December 25, 2017 Posted December 25, 2017 DirCreate (@HomeDrive & "\Program Files\Common Files\Macrovision Shared") returns 0 Therefore other code does not work because it fails to create the folder. I looked into security and changed permissions of the entire C drive form "trusted installer" to "authenticated users" but no luck. My user is administrator but not "actual" administrator (you know, the hidden administrator account) The reason why i use the string so specifically instead of @programsdir or what ever, is because otherwise it will end up in a x86 folder because of the stupid redirection. MS should have had "Program Files X64" folder for 64bit os instead of Program Files (x86). Life would be allot easier.
Moderators JLogan3o13 Posted December 25, 2017 Moderators Posted December 25, 2017 It has nothing to do with Program Files vs. Program Files (x86). For either directory, you have to put #RequireAdmin at the top of your script in order to create a sub directory. This is the same with all Windows protected directories, "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!
tonycst Posted December 26, 2017 Author Posted December 26, 2017 I get problems when i add #RequireAdmin in the script. Half the commands including arguments passed to command prompt via @comspec do not run properly. Execution level at which script is being executed does not seem to travel across every other executable its programmed to execute. FOr example/ Script.exe says to cmd.exe to start program.exe Because cmd.exe located in a secure place, it assumes that script.exe needs to be limited to standard user access level. Then cmd.exe executes program.exe with lower previledges then original script.exe was executed. i had this issue years ago since windows 7 came out. The only solution to this very day i see is to run all my scripts in Administrator account rather then any user account with administrative privileges.
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