Hide Command Window while Running Online Batch Script with K1000?
Is it possible to hide the cmd.exe window while running an online shell script?
Answers (8)
One of the easiest ways to do this is to use the "View the raw XML editor" and change the type= setting from policy to hidden.
<config name="Blah blah script for whatever" type="hidden" id="150" version="1393522756" description="Blah blah blah">
When you do this, the script runs in an entirely silent mode with no windows being shown to the end user.
Comments:
-
Worked for my powershell script running on our 700 Windows 7 workstations. Thanks. - davidgrand 10 years ago
-
I have been trying to find this information for almost a year now. Thank you so much! - Jhogue 9 years ago
I was just running into the same issue. Someone poined me to this tool. It is a batch to exe converter, and it is working for me. You can set it to run invisible when you create the exe.
Comments:
-
But you will have to run it as an Online Kscript or Ofline Kscript and choose launch a program. - WGM_Jeff 12 years ago
-
I relied heavily on this tool for years, but more and more Anti-malware and AV tools are killing it. Too much hassle. - kelleyplumos 9 years ago
Does the cmd.exe window show your batch script or is it just a blank window? I had a similar issue with batch files inside of managed installs showing a blank command prompt window the entire time the install was running. It turned out to be a bug. To get around it I used iexpress to wrap the batch file in an exe and run it that way. Or I believe you can also call the batch file silently through a VB script.
Comments:
-
2nd that on the VB script. - Aaron Cool 12 years ago
-
It's is a blank window. I will check out the VB script call.
Yeah, this blank cmd window sits there... which doesn't work out if a user is active on the machine. - muebel 12 years ago -
VS script is the easiest route I agree. it simple calls the exe inside an invisible window. I swear I answered this question yesterday. - RandomITPro 12 years ago
-
yeah, actually searching now I can see this is a very common question. my bad! - muebel 12 years ago
-
Is this a bug within the K1000?
If it's something that is likely to be fixed in a future update I can live with it.
It is only happening on our Windows 7 machines and we don't have too many of them yet. - Arcolite 12 years ago
I do not believe you can change any aspect of how an Online Shell Script is executed.
I would recommend using an "Offline KScript" or "Online KScript" and launching the script via Wscript.exe instead, with the following syntax:
Launch “$(KACE_SYS_DIR)\wscript.exe” with params “//B //nologo scriptname.sh"
To help others wasting time trying to resolve this: it will not happen without an agent update.
This is a known bug (AGENT-2026) and I have encountered it as early as November 2011. For whatever reason the bugfix did not make it in the most recent agent releases and from what I have been told several times now it will not be fixed until 5.4 comes out.
This is a major problem to my org: we deploy over 150 titles to ~5000 Windows stations used by 15000 students and staff on a daily basis. Telling a 4th grader not to close the command window is like waving a red flag in front of a bull; our desktop guys are having to uninstall and reinstall apps by hand dozens of times every day (and that's just those that call and complain).
So if this is causing you as much grief, please call support and scream and holler. Maybe the bugfix timeline will move up. Or do what I am about to do: spend a couple of hundred hours recreating and testing your managed installs as KBOX scripts or go back to what you were using before you paid for the KBOX.
You can try Cmd.exe /c
Apart from that I do not think it is possible to hide it.
Comments:
-
Even so, could you post an example script using that wscript.exe? - tdickert 12 years ago