Hiding a CMD.EXE shell.

I

Ian_m

I have switched my XPe "shell" (via registry change) to CMD.EXE that runs a
startup scripts. These scripts basically uses START /WAIT to spawn processes
and if the process exits (shouldn't ever...but...) just restarts it again.

However the initial CMD window is full size.

Is there either :-

- A way to hide this CMD windows completly, so user can't find it and fiddle.
- Start it up minimised ?
 
T

taha.snoussi

I have switched my XPe "shell" (via registry change) to CMD.EXE that runs a
startup scripts. These scripts basically uses START /WAIT to spawn processes
and if the process exits (shouldn't ever...but...) just restarts it again.

However the initial CMD window is full size.

Is there either :-

- A way to hide this CMD windows completly, so user can't find it and fiddle.
- Start it up minimised ?

Hi,
You can just use Start /MIN to get it minimised.
Another tip is to write a c++ program that runs your shell script in
hidden mode.

HTH
Taha
 
L

limbokiller

I have switched my XPe "shell" (via registry change) to CMD.EXE that runs a
startup scripts. These scripts basically uses START /WAIT to spawn processes
and if the process exits (shouldn't ever...but...) just restarts it again.

However the initial CMD window is full size.

Is there either :-

- A way to hide this CMD windows completly, so user can't find it and fiddle.
- Start it up minimised ?

may i ask you how you did that could you send the script to me?
 
I

Ian_m

may i ask you how you did that could you send the script to me?

Change shell to:

C:\Windows\System32\Cscript.exe //b //nologo C:\Config\startup.vbs

startup.vbs is...

Const HIDDEN_WINDOW = 12
strComputer = "."
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objStartup = objWMIService.Get("Win32_ProcessStartup")
Set objConfig = objStartup.SpawnInstance_
objConfig.ShowWindow = HIDDEN_WINDOW
Set objProcess = GetObject("winmgmts:root\cimv2:Win32_Process")
errReturn = objProcess.Create("C:\Windows\System32\Cmd.exe /c
C:\Config\Startup.cmd", null, objConfig, intProcessID)

And startup.cmd is

@echo off
:loop
start /wait /max iexplore.exe http://192.168.0.1
goto loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top