Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script, permissions and Run As Administrator

Status
Not open for further replies.

GordonPrice67

IS-IT--Management
Mar 12, 2012
5
0
0
US
I have a script that needs to copy a file to Program Files (x86) after first running a software deployment package (Autodesk Revit, FWIW). If I launch the script directly it runs fine until it reaches the line to copy the file, and then errors out with permissions issues, as expected.
If I launch Command Prompt using Run as Administrator, it instead errors out with a Path not found back at the Revit deployment line, which ran just fine when the script was launched directly. Any thoughts on why a command prompt launched script would behave differently?

Also, is this the only way to get around the permissions issue? I understand the desire to limit scripts from writing to Program Files. But this file must be replaced for business reasons, the Autodesk installer gives me no way to address this directly (don't even get me started on how piss poor Autodesk's deployment tools are) and doing this copy manually for hundreds of machines in multiple offices is simply not viable.

Note that this script is being deployed within the AEC (Architecture, Engineer & Construction) Industry, where really advanced IT practices are not very commonplace. And the script in question almost certainly will need to be revised and edited by the IT staff over the years. So signed code is likely not an ideal solution realistically, even if it is a good solution technically.

Any help is greatly appreciated!
Gordon
 
Hmm, interesting. After some Windows Updates even Run as Administrator doesn't work. However, I had the same issue with with a different file (but still in Program Files) at Revit rollout last year, and Run as Administrator did the trick. The thing is, Run as Administrator asked for a password then. Now it just runs. Logged in with an Admin account in both cases.

Any thoughts? I am desperate, as there are going to be literally hundreds of manual copies i=f I can't get this to work scripted. maybe Autodesk will fix the problem before next year. ;)

Thanks,
Gordon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top