/build/static/layout/Breadcrumb_cap_w.png

Scripting help

If someone could be so kind as to show an example of how to run a silent bat file.  Someone posted this code:

Launch $(KACE_SYS_DIR)\wscript.exe” with params “//B //nologo scriptname.sh"

But I am at a loss as to how exactly to get a .bat file to excute silently with no CMD window showing up on the client.  Should I create a new Online Shell Script and then post the above code in and where it says "scriptname.sh" it could point to a UNC patch where I have a simple .bat file that does the actuall install?


0 Comments   [ + ] Show comments

Answers (2)

Answer Summary:
Posted by: jaredv 12 years ago
Fourth Degree Green Belt
4

Batch files can not be run invisibly through any parameter (ie cmd /c).

The wscript command will only work with the following file name extensions: .wsf, .vbs, .js, .sh.

Therefore, to use a batch file invisibly, a workaround must be used.

 

To use wscript to launch a batch file silently, follow these steps:

  1. Create a file named invisible.vbs (use Notepad Save As... All Files) with the following line: CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
  2. Create an Online or Offline KScript
  3. Upload the invisible.vbs file and your batch file.
  4. Add the following step to Task 1: Launch $(KACE_SYS_DIR)\wscript.exe with params $(KACE_DEPENDENCY_DIR)\invisible.vbs $(KACE_DEPENDENCY_DIR)\launch.bat

*The invisible.vbs script does not need to be customized for the specific batch file, so that file you created can be used any time you need to do this.

 

These instructions were based on the post found here: http://forums.techguy.org/dos-other/644932-solved-howto-run-batch-file.html


Comments:
Posted by: WGM_Jeff 12 years ago
4th Degree Black Belt
2

I have not been able to get a batch file to install without popping up the command prompt window at all through KACE. I ended up taking the advice of someone on here, and downloaded a batch to exe converter that has an option to create an exe that will run completely invisible. Here is the link to the converter.

http://www.f2ko.de/programs.php?lang=en&pid=b2e

 
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