Hide the command prompt windows When runing .bat file
#1
Posted 18 August 2005 - 03:44 AM
#2
Posted 18 August 2005 - 03:17 PM
If you want it completely hidden, then try using scripting:
[urlhttp://www.microsoft.com/technet/scriptcenter/scripts/os/process/procthd/pcthvb02.mspx[/url]
Modify the sample script to run something like "cmd.exe /c abc.bat" instead (with abc.bat replaced with the actual filename).
#3
Posted 18 August 2005 - 03:53 PM
#5
Posted 18 August 2005 - 04:36 PM
#6
Posted 18 August 2005 - 09:41 PM
Here's another way to do it, using JScript (the sample mentioned earlier uses VBScript; this could be done in VBScript too, but as a matter of personal preference I use JScript instead)
var WindowStyle_Hidden = 0
var objShell = WScript.CreateObject("WScript.Shell")
var result = objShell.Run("cmd.exe /c abc.bat", WindowStyle_Hidden)
If you want to try this, save it to a file with a .js extension.
#7
Posted 19 August 2005 - 01:04 AM
Since you seam to know about writing scripts can you answer this question. I have this .bat file that when run it asks "Are you sure you wan't to add the information in (where the .reg file is) to the registry? and under this it has the two buttons that say "Yes" and "No" every time I want to "click" yes (why else would I run the .bat file) How can I make a .vbs file that dose this with out the user imput. Also after pressing yes it comes up with "Information in (where the .reg file is) has been successfully entered into the registry" and under that is the OK button and I want it to automaticly "click" this as well. Thanks very much for any help.
#8
Posted 19 August 2005 - 09:48 AM
http://support.microsoft.com/default.aspx?...=kb;en-us;82821
#9
Posted 19 August 2005 - 10:18 AM
and what are you exactly trying to create? a virus?
such things should not be encouraged on public forums...
#10
Posted 19 August 2005 - 04:56 PM
The other aim it to learn the basics of programing, that is why I started doing this in the first place is made the thing that I wrote usefull to me.
I know that I could make a virus but I see no point in that at all, the people that do have a very weird sence of fun. Do you think that I would make thing harder than they already are for the people that help here (that includes me).
#11
Posted 20 August 2005 - 04:53 AM
#12
Posted 20 August 2005 - 05:06 AM
#13
Posted 23 August 2005 - 07:37 PM
#14
Posted 23 August 2005 - 09:15 PM
Suggestion: un-hide the window temporarily (if you haven't tried that already); there may be error information available that you haven't seen. If one of the scripts is still based on the VBScript example mentioned earlier, then to use a normal window set objConfig.ShowWindow to 1 instead of HIDDEN_WINDOW.
#15
Posted 23 August 2005 - 10:05 PM
It comes up with a windows called "Windows Script Host"
Script: (what ever one that I am trying to run)
Line: 4 (with the ones that I made it is all ways this line)
char: 1
Error: The remost server machine dose not exits of is unavailable: 'GetObject'
Code; 800A01CE
Source: Microsoft VBScript runtime error
Hope this helps!

