Windows Thread, Run Script as Administrator in Technical; We have received 3 update files in the form of .msp packages. I have written a piece of script to ...
-
20th November 2006, 11:02 AM #1
- Rep Power
- 0
Run Script as Administrator
We have received 3 update files in the form of .msp packages. I have written a piece of script to run all three passivly and it works. However it will only run as an administrator. Is there a way either through login scripts or through the loginscript element of group policies to make the script work, either on its own or by forcing it to run as administrator/system?
Thanks
Tom
-
-
IDG Tech News
-
20th November 2006, 11:10 AM #2 Re: Run Script as Administrator
The whole point of a .MSP file is to update an administrative install of a product. If you simply apply the .MSP to the admin install point, your clients (which have installed the app using a .MSI via GPO) will automagically upgrade without needing a script.
-
-
20th November 2006, 11:53 AM #3 Re: Run Script as Administrator

Originally Posted by
Ric_ The whole point of a .MSP file is to update an administrative install of a product. If you simply apply the .MSP to the admin install point, your clients (which have installed the app using a .MSI via GPO) will automagically upgrade without needing a script.
Not quite! An MSP can be used to patch an Admin install point, or an installed application. Assuming the application has been installed from an admin installation point and the patch subsequently applied to that install point, then the application would need 're-cacheing' on the PC, using a command like...
msiexec /i [path to updated .msi file on the administrative image] REINSTALL=ALL REINSTALLMODE=vomu /qb
I suppose this could be done with a Startup Script.
It may also be possible to select the 'redeploy application' action on an assigned MSI but I don't know exactly what effect this would have.
-
-
20th November 2006, 12:23 PM #4 Re: Run Script as Administrator

Originally Posted by
ajbritton It may also be possible to select the 'redeploy application' action on an assigned MSI but I don't know exactly what effect this would have.
It does what it says it says on the tin!
-
-
20th November 2006, 12:43 PM #5 Re: Run Script as Administrator

Originally Posted by
ChrisH 
Originally Posted by
ajbritton It may also be possible to select the 'redeploy application' action on an assigned MSI but I don't know exactly what effect this would have.
It does what it says it says on the tin!
OK, so is that an un-install followed by a reinstall, or a repair, or a re-cache? I've seen differing behaviour from this action, depending on the MSI file.
-
-
20th November 2006, 02:55 PM #6
- Rep Power
- 0
Re: Run Script as Administrator

Originally Posted by
TSCNUK We have received 3 update files in the form of .msp packages. I have written a piece of script to run all three passivly and it works. However it will only run as an administrator. Is there a way either through login scripts or through the loginscript element of group policies to make the script work, either on its own or by forcing it to run as administrator/system?
Thanks
Tom
If for some reason you can persue the GPO installtion as per ChrisH and ajbritton then your best bet is a startup script. This will have admin privilidges. Alternative you can set a scheduled job on the target computers to run the script. This will aslo be procesed with admin powers.
The last option might be to use the EXE packager in AdminScriptEditor to created an encrypted executable. This would allow you to place an explitict run as command in you script with a plain text admin password.
-
-
20th November 2006, 04:38 PM #7 Re: Run Script as Administrator
The trick with running a seperate script will be to make sure the script only runs once. There are many ways of doing this, but basically what is needed is some kind of 'flag' on the target PCs. The script should check for the presence of the flag before running the update. If the flag is not present, then the update may be run and the flag set to prevent future runs of the script.
example CMD script
Code:
rem Check for flag
if exist C:\AppName_Update_X.txt then goto jExit
rem - add script code here to install Update X for AppName
rem - Add the flag
echo Update X installed at %TIME% on %DATE% > C:\AppName_Update_X.txt
:jExit
-
-
20th November 2006, 04:52 PM #8
- Rep Power
- 0
Re: Run Script as Administrator
You could also have markers in the registry using the REG command (or KiX or VBS/JS) but the main problem remains how to how run with elevated privilidges with out having clear text logon details readable by non-tech users.
-
-
20th November 2006, 05:20 PM #9 Re: Run Script as Administrator

Originally Posted by
NetworkGeezer the main problem remains how to how run with elevated privilidges with out having clear text logon details readable by non-tech users.
Assuming you have Active Directory, then a Startup Script will do it as you pointed out.
-
SHARE:
Similar Threads
-
By Galway in forum Windows
Replies: 3
Last Post: 29th August 2007, 11:00 AM
-
Replies: 8
Last Post: 12th November 2006, 03:02 PM
-
By Gatt in forum Windows Vista
Replies: 0
Last Post: 2nd April 2006, 09:51 AM
-
By richard in forum How do you do....it?
Replies: 17
Last Post: 11th March 2006, 11:36 PM
-
By Geoff in forum Jokes/Interweb Things
Replies: 1
Last Post: 5th December 2005, 01:06 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules