Sign in to follow this  
Followers 0
MiketheBake

Compatability pack for Office 2007 install script.

10 posts in this topic

Here is my situation.

I am a desktop support specialist, for my company. We have 600 PCs in our Domain which all them are running Office 2k3. We need to push out the office compatibility pack, so people can open Office 2k7 Documents (.docx, .xlsx). None of my users have Administrator Privileges on there Machines. So I can't just send them the link and have them install it from a shared network Drive. We do not have an SMS or SCCM server to push software, and updates out.

I am looking for a script that will allow me to use an account that has Local Administrative Privileges to install the Compatibility pack. I would like just be able to send the user a link to the script\file so all they have to do is click the link and have it install.

I would like to use the runas if it is possible.

Is something Like this Possible?

Please do not Flame me because of my post count. I was just introduced to this wonderful program and website and am looking forward to utilizing it many features and capabilities.

Thanks in advanced, :)

MiketheBake

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Yeah, RunAs() should do the trick. I would recommend:

- Creating a new temp user account with Local Administrative Privileges / try to minimize the priviliges as much as possible (deny interactive usage possible?)

- Use the _StringEncrypt() function to encrypt the embedded password (or other encr. function, search examples)

- Use Obfuscater to make the script harder to read

- EDIT: Thoroughly test the script :)

- Put the compiled script at the same network location as the package

- Send a link to the script to the users

- After all users installed the package delete the new temp user account with Local Administrative Privileges

Just to be on the safe side, I'm NOT in the administrative business :)...

Edited by KaFu

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Yeah, RunAs() should do the trick. I would recommend:

- Creating a new temp user account with Local Administrative Privileges / try to minimize the priviliges as much as possible (deny interactive usage possible?)

- Use the _StringEncrypt() function to encrypt the embedded password (or other encr. function, search examples)

- Use Obfuscater to make the script harder to read

- EDIT: Thoroughly test the script :)

- Put the compiled script at the same network location as the package

- Send a link to the script to the users

- After all users installed the package delete the new temp user account with Local Administrative Privileges

Just to be on the safe side, I'm NOT in the administrative business :)...

Thanks for quick reply. However I am not a scripter. Would it be possible if someone could provide the script? That way I can put the credentials of the local administrator, and UNC path of the .exe that I need to push.

Please forgive my non scripting knowledge.

Edited by MiketheBake

Share this post


Link to post
Share on other sites

Thanks for quick reply. However I am not a scripter. Would it be possible if someone could provide the script? That way I can put the credentials of the local administrator, and UNC path of the .exe that I need to push.

Please forgive my non scripting knowledge.

We don't really do that on this forum, this more like education/support for you learn and use AutoIt.

There are ways to script what you want to do, and if you want to learn them this is certainly the right place.

Otherwise, you might check the Rent-A-Coder link in my sig.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

We don't really do that on this forum, this more like education/support for you learn and use AutoIt.

There are ways to script what you want to do, and if you want to learn them this is certainly the right place.

Otherwise, you might check the Rent-A-Coder link in my sig.

:)

I totally understand.

So let me rephrase the question. It works with the someone with the administrative privileges (of course). I cannot figure out how to get it to use the provided credentials.

What am I doing wrong?

Here is the script that I have now.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****

#AutoIt3Wrapper_Run_Before=Option explicit

#AutoIt3Wrapper_Run_Before=Dim oShell

#AutoIt3Wrapper_Run_Before=set oShell| Wscript.CreateObject("WScript.Shell")

#AutoIt3Wrapper_Run_Before=oShell.Run "runas /noprofile /user:domain\user ""***Unc PAth***""

#AutoIt3Wrapper_Run_Before=WScript.Sleep 100

#AutoIt3Wrapper_Run_Before=oShell.Sendkeys "Password~"

#AutoIt3Wrapper_Run_Before=Wscript.Quit

#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

Run('***Unc PAth***')

WinWait("Compatibility Pack for the 2007 Office system","")

If Not WinActive("Compatibility Pack for the 2007 Office system","") Then WinActivate("Compatibility Pack for the 2007 Office system","")

WinWaitActive("Compatibility Pack for the 2007 Office system","")

MouseMove(24,438)

MouseDown("left")

MouseUp("left")

MouseMove(705,444)

MouseDown("left")

MouseUp("left")

MouseMove(159,74)

MouseDown("left")

MouseUp("left")

Thank you

Share this post


Link to post
Share on other sites

I got it figured out.

This is what I had to do.

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
RunAs ( "username", "Domain", "password", 4, "Filename.exe" ,"Directory")
WinWait("Compatibility Pack for the 2007 Office system","")
If Not WinActive("Compatibility Pack for the 2007 Office system","") Then WinActivate("Compatibility Pack for the 2007 Office system","")
WinWaitActive("Compatibility Pack for the 2007 Office system","")
MouseMove(25,441)
MouseDown("left")
MouseUp("left")
MouseMove(705,444)
MouseDown("left")
MouseUp("left")
MouseMove(173,75)
MouseDown("left")
MouseUp("left")

thanks to all who took the time to help.

Now we can let the thread fall to the abyss of threads.

:)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I advise you

a ) to use other mechanisms as mousemove / mousedown to write such a program... or are you sure, that all PC will have the same desktop resolution? That the user won't move the installation dialogue? Better use something like controlsend and controlclick

b ) at least implement basic security by encrypting the password in the file with _StringEncrypt()

c ) to test your script on the different desktop configurations your company for sure has

Best Regards

Edited by KaFu

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Damn, there is always a more elegant solution :)

I actually did this for the place i work as well, but we have over 2000 computers, there are good ways to push it out, but i just made a script to runas() and then let them click through the approval, nobody had issues with that. however if you have anybody smart enough to realize its an autoit script and converts it back to au3 from an exe then you just gave out the password. but that isn't likely.


func get_quote()
   local $quote 
   switch random(1, 3, 1)
    case 1
     $quote = '"' & "A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, " & _
       "design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give " & _
       "orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, " & _
       "fight efficiently, die gallantly. Specialization is for insects." & '"' & " Robert A. Heinlein"
    case 2
     $quote =  '"' & "Within each of us lies the power of our consent to health and sickness, to riches and poverty, to freedom " & _
       "and to slavery. It is we who control these, and not another." & '"' & " Richard Bach (Illusions)"
    case 3
     $quote ='"' & "Don't handicap your children by making their lives easy." & '"' & " Robert A. Heinlein"
   EndSwitch
   MsgBox(0, "Quote for the moment", $quote & @CRLF)
EndFunc

get_quote()

Share this post


Link to post
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
Sign in to follow this  
Followers 0