Install program remotely with batch file.

I need a batch file to install a Window update on a remote machine. I need to have it check if its online, if its not exit out with an error, if its online look for C:\Temp, if its not there create it. Then copy over the file to C:\Temp and run the file using psexec.exe.

The reason why we are doing it this way is because SCCM is not working for us and NO we cannot use other deployment software. I am however allowed to use a batch file or script.
LVL 19
Edward PamiasTeam Lead RRS DeskAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott CSenior EngineerCommented:
I stumbled across this....Invoke-Command -ComputerName yourpc {wusa.exe C:\temp\gpsvc\Windows6.1-KB2561285-x64.msu /quiet /norestart}

See if it will work for you.

In a PS do a Get-Help Invoke-Command and look at the parameters.  It looks like it may do the trick for you.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Edward PamiasTeam Lead RRS DeskAuthor Commented:
Scott is the file in my C:\Temp or the users C:\Temp?
David Johnson, CD, MVPRetiredCommented:
on the computer specified by -computername
Edward PamiasTeam Lead RRS DeskAuthor Commented:
Thank you Scott!
Edward PamiasTeam Lead RRS DeskAuthor Commented:
I thought I had selected Assisted for David. Sorry. :(
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.