I want the batch file to be invisible to the user while it's running.
Thanks.
Peter
cmdow is one tool designed with this in mind.
CMDOW [Version x.x.x] Win32 Commandline Window Utility for NT4/2000/XP.
(C) Copyright 2001-2004 Ritchie Lawrence, http://www.commandline.co.uk.
You'll have to test it in W7
--
Regards,
Mic
Mic - thanks for the suggestion. CMDOW looks like it will do the job.
I assume you use it or have used it so I hope you can answer this
question for me. I will be running it from a batch file. According
to the documentation on their web site the command line would be:
CMDOW [Window] /hid
for [Window] I can use either the window's "unique handle in
hexadecimal format" or the window's "caption." The window I want to
hide is the window the batch file is running in. How do I determine
that window's hex format and/or caption?
Thanks.
Peter
>> cmdow is one tool designed with this in mind.
>> CMDOW [Version x.x.x] Win32 Commandline Window Utility for NT4/2000/XP.
>> (C) Copyright 2001-2004 Ritchie Lawrence,http://www.commandline.co.uk.
>> You'll have to test it in W7
>
>
>Mic - thanks for the suggestion. CMDOW looks like it will do the job.
>
>I assume you use it or have used it so I hope you can answer this
>question for me. I will be running it from a batch file. According
>to the documentation on their web site the command line would be:
>CMDOW [Window] /hid
>
>for [Window] I can use either the window's "unique handle in
>hexadecimal format" or the window's "caption." The window I want to
>hide is the window the batch file is running in. How do I determine
>that window's hex format and/or caption?
Untested:
@echo off
title HiddenWindow
rest of batch here
and use HiddenWindow as the caption in cmdow
--
Regards,
Mic
> The window I want to
> hide is the window the batch file is running in.
::----- START -----
REM Hide this console window so its not shown on taskbar
@CMDOW @ /HID
REM Rest of your script below here
::------ END ------
Mic:
I tried that and I get the following error message right after the
line with Cmdow executes in the batch file:
Error: The specified window was not found.
I know the Title command is working because the window title does
change but there is something about the Cmdow command line in the
batch file that's not correct. This is what I have: cmdow ABCwindow /
hid Is that the correct syntax?
Thanks.
Peter
Carlos:
Thanks. That works about 99%. The only thing that happens that I
don't want is when I run the batch file the window opens for a split
second before HIDE kicks in. It goes by very quickly but it is
visible to the user. Is there any way to deal with that issue - so
that the whole process is 100% invisible to the user?
Thanks for your help with this!
Peter
>Carlos:
>
>Thanks. That works about 99%. The only thing that happens that I
>don't want is when I run the batch file the window opens for a split
>second before HIDE kicks in. It goes by very quickly but it is
>visible to the user. Is there any way to deal with that issue - so
>that the whole process is 100% invisible to the user?
Ten's syntax does the job but you are also presented with a flash of the
dos window.
::----- START -----
REM Hide this console window so its not shown on taskbar
@CMDOW @ /HID
REM Rest of your script below here
::------ END ------
Perhaps you can create an executable for your task by using Pure basic etc.
--
Regards,
Mic
The thing you want done cannot be done. All console program are run by
CMD and CMD first opens a window before running any console programs. To
prevent the window from opening at all you must begin with a non-console
program. Maybe Visual Basic Scripting is your solution. There was also a
discussion here a year or two ago in which some C code was presented
which will launch the console application through the GUI. Search for
"ShellExecute" and "Frank"; that might locate the discussion.
Frank
This is the discussion I was thinking of but it doesn't do what I
thought:
<http://groups.google.com/group/alt.msdos.batch.nt/browse_thread/thread/70f1fd2b7847f666/e4b5b6bde431b098>The launcher should use WinMain() and launch it through CreateProcess()with a flag for no console. But you will probably be more successful ifyou write your script in Visual Basic Scripting and use WScript.exe tolaunch it.Frank
This works. Since I am starting this batch file from a desktop
shortcut I went into the properties for the batch file and selected
Run Minimized. That got rid of the "flash" of the opening DOS window.
Question: The /HID hides the window. I assume it is not necessary for
me to do any type of Un-hide at the end of the batch file since the
window will just close at that point and there will be nothing to un-
hide. True?
Peter
Check in task manager to see if the process has closed.
--
Regards,
Mic
I have used WSH to run batch files in a hidden shell for years. Nothing to
download. No C code to compile. No button displayed on the task bar. Just
plain VBScript code.
'RunHidden.vbs
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "YourBatchNameHere.cmd", 0
I keep wscript.exe set as my default host so no additional shortcut is
necessary. However, if you need to run on unknown systems where cscript.exe
might be set as user's default, you can create a shortcut to make sure
wscript.exe will be the host that will run the script. The VBScript code is
easily modified to accept the batch name as an argument to use a single
vbscript to load any batch as hidden.
Caveat #1: Running your batches as hidden means that it must not require any
user intervention to complete. The batch must be fully tested so there are
no user prompts to address before using the RunHidden VBScript.
Caveat #2: If running a second instance of the batch would interfere with
the first instance (ie. overwrite working or temp files), then you should
include a mechanism within the batch code to prevent multiple instances from
running.
--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)
--- news://freenews.netfront.net/ - complaints: ne...@netfront.net ---
Hidden Start 22 KB (Freeware)
Web: http://www.ntwind.com/software/utilities/hstart.html
Download: http://www.ntwind.com/download/hstart.zip
Example:
HSTART.EXE /NOCONSOLE "C:\Path To\AnyName.bat"
ju.c
"Peter" <pmok...@gmail.com> wrote in message news:47096d4d-2962-4164...@o16g2000vbf.googlegroups.com...
--- news://freenews.netfront.net/ - complaints: ne...@netfront.net ---