KACE Product Support Question

How do you run a shell script in k2000?

05/04/2016 2406 views

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.

Answer Summary:
0 Comments   [ + ] Show comments


Answer Chosen by the Author

I'm using the PowerShell script from here:

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.

Answered 05/04/2016 by: chucksteel
Red Belt

  • Thanks chucksteel. Will try it.
  • 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??
    • 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.
      • 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?
      • The peinst and petemp shares are hidden so if you just browse to the k2000 they won't show, but they are there.
  • Thanks Chuck. All sorted.

Don't be a Stranger!

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

Sign up! or login


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