Is it possible to hide the cmd.exe window while running an online shell script?

Answer Summary:
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Community Chosen Answer

3

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.

Answered 02/27/2014 by: angrymidget
White Belt

  • Worked for my powershell script running on our 700 Windows 7 workstations. Thanks.
  • I have been trying to find this information for almost a year now. Thank you so much!
Please log in to comment

Answers

2

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.

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

Answered 04/18/2012 by: WGM_Jeff
Fourth Degree Black Belt

  • But you will have to run it as an Online Kscript or Ofline Kscript and choose launch a program.
    • I relied heavily on this tool for years, but more and more Anti-malware and AV tools are killing it. Too much hassle.
Please log in to comment
1

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.

Answered 04/18/2012 by: bparme
Orange Belt

  • 2nd that on the VB script.
  • 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.
  • VS script is the easiest route I agree. it simple calls the exe inside an invisible window. I swear I answered this question yesterday.
    • yeah, actually searching now I can see this is a very common question. my bad!
  • 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.
Please log in to comment
1

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"
Answered 04/18/2012 by: jaredv
Fourth Degree Green Belt

  • I don't seem to have the option of "Offline Shell Script". The only Shell Script option we have is "Online".
  • Sorry, that should've been 'Offline KScript' with that command. I've fixed the original comment.
Please log in to comment
1

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.

 

Answered 05/24/2012 by: merklo
Senior White Belt

Please log in to comment
0

And here's the utility I like: Hidden Start at http://www.ntwind.com/software/hstart.html .

Not only can it hide the window, it can also delay and can handle UAC prompts.

Answered 04/20/2012 by: snissen
Fourth Degree Green Belt

Please log in to comment
0

You can try Cmd.exe /c

Apart from that I do not think it is possible to hide it.

Answered 04/17/2012 by: piyushnasa
Red Belt

  • Even so, could you post an example script using that wscript.exe?
Please log in to comment
0
Answered 04/18/2012 by: Aaron Cool
Red Belt

  • This content is currently hidden from public view.
    Reason: Removed by user request
    For more information, visit our FAQ's.
Please log in to comment
Answer this question or Comment on this question for clarity