/build/static/layout/Breadcrumb_cap_w.png

How do you run a shell script in k2000?

Hi people,

I am trying to run a shell script to install windows updates

as a post install task in  the k2000.

Basically how do you run powershell scripts in version 3.7 and upis what I want to know..

I read online that you should save the code below as a batch file.......

xcopy “%~dp0*.*” c:\windows\temp\ /s /y /e
powershell -noprofile -command Set-ExecutionPolicy bypass LocalMachine
powershell -file C:\windows\temp\myPowershellScript.ps1


and then zip it up with your shell script and upload to the k2., then call the

batch file in the post install task.

Not working for me....... SO HOW DO I RUN ANY POWERSHELL SCRIPT

IN K2000??

Thanks guys.


0 Comments   [ + ] Show comments

Answers (1)

Answer Summary:
Posted by: chucksteel 8 years ago
Red Belt
0

Top Answer

I'm using the PowerShell script from here:
https://gallery.technet.microsoft.com/scriptcenter/Simple-Windows-Update-Tool-3a505873

This is my installupdates.bat
powershell.exe -executionPolicy bypass -file WindowsUpdate.ps1 -UpdateTypes All

I put the two files in a zip then created a new Post-Install task as an application (you can't upload attachments to a script). For the parameter enter installupdates.bat.


Comments:
  • Thanks chucksteel. Will try it. - akmagnum 8 years ago
  • Hey chuck...
    Kace gives me the same error that it was giving me
    with other scripts I tried to run from a zip file...
    error is...

    windows cannot find 'installupdates.bat'. Make sure you type the name correctly, and then try again.

    Any ideas??
    Thanks - akmagnum 8 years ago
    • When you created the zip file did you right click on the batch file and the other file or did you have them in a folder? If you have them in a folder and you compress that folder then they will be inside that folder when uncompressed. You can check the \\k2000\peinst share (you'll need the SAMBA password) to see what the files look like. Look in Applications, the ID of the post-install task, then contents. - chucksteel 8 years ago
      • Ok , I think I have a problem.
        I don't have a peinst share in my \\k2000.
        I have a "drivers" folder, a "drivers_postinstall" folder, and a "restore"folder.
        Why is it I don't have one??
        I don't think I deleted it . I wouldn't do that.
        How can I get it back?
        Thanks! - akmagnum 8 years ago
      • The peinst and petemp shares are hidden so if you just browse to the k2000 they won't show, but they are there. - chucksteel 8 years ago
  • Thanks Chuck. All sorted. - akmagnum 8 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ