K1000: How do you push Scripts (Invisibly) to your Workstations?
This is how I do it. I am trying to figure out if I am missing something that would make this process less annoying, but here it is:
- Create new offline KScript
- Attach all the dependencies I am going to need.
- One of these dependencies is "invis.vbs" which just takes in a batch file and executes it.
- Create a task which executes the program %systemroot%\system32\wscript.exe with parameters $(KACE_DEPENDENCY_DIR)\invis.vbs $(KACE_DEPENDENCY_DIR)\BATCH_FILE.bat
This makes the script essentially only usable when run by the kagent, and also that I have to create the kscript before I can figure out what the number is going to be.
powershell -command "& {gwmi win32_product |? {$_.name -match 'Adobe Reader'}}"
How do you push scripts invisibly? There has to be a more elegant way...
Answers (2)
Are you referring to the CMD prompt that pops up for a few seconds? I've had success using http://www.f2ko.de/programs.php?lang=en&pid=b2e I first create a .bat with something like this:
@echo off powershell.exe -nologo -executionpolicy bypass -noprofile -file script.ps1
Then using the converter I include my .ps1 file. This will compile the powershell script as an exe and it will deploy silently.
I've also used shell scripts to deploy Powershell. Just upload the .ps1 as a dependency and add this. Make sure to change to script.bat at the bottom. (Still displays the CMD prompt for a couple of seconds)
Comments:
-
So the actual answer is:-
THE K1000 CANNOT RUN VBSCRIPT OR POWERSHELL SCRIPTS WITHOUT A BLACK CMD BOX POPPING UP FOR AT LEAST A FEW SECONDS.
This is because the K1000 agent does not support windows scripting or powershell requiring you to run cscript.exe or powershell.exe programs in cmd windows or BAT file.
I'd love someone to show me how, other than use software to convert scripts into executable program files. - Geedoubleu 11 years ago -
I use wscript.exe to run the invis.vbs script silently - muebel 11 years ago
I now use this method in order to ensure the script knows where it's dependencies are. - muebel 11 years ago