Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to get a scheduled task on Windows 7 to execute once a minute, using schtasks and a batch file.

My .bat batch file is:

@ECHO OFF
wscript "c:\http.vbs"

The .vbs script si a simple one, it performs a basic HTTP request:

Function HTTPGet()
    HttpRequest("my_url_is_here")
End Function

If I run the .bat file from a command prompt, it does its job nice and smooth. But if I try to schedule the .bat, i.e.

schtasks /create /sc minute /tn "HTTPCheck" /tr "C:\HTTPCheck.bat"

I keep seeing the command prompt window for a split second on my screen, each minute. Is there something I could do to prevent that window from flashing before my eyes?

Thanks!

L.E. I cannot use third party software, I want regular users to be able to run it w/o installing anything.


Long story short, I need to make a HTTP GET request without having the command prompt window pop out on my screen every minute.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Cristian,

I don't know how others choose to do it, but I've used JoeWare's "Quiet" program to spawn hidden (except from taskmgr) batch files in the background.

http://www.joeware.net/freetools/tools/quiet/index.htm

You could also wrap the batch file (a little funny since it is calling a vbs) inside a vbscript file such as:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\HTTPcheck.bat" & Chr(34), 0
Set WshShell = Nothing

The "0" parameter will force it to run hidden.

share|improve this answer
    
It works now, but I have to make do with 3 files: HTTPcheck.vbs with your code, HTTPcheck.bat which, in turn, calls http.vbs Wish I'd knew how to compact those files in one .vbs script, or at most 2 files, a .bat and a .vbs. Thanks! –  Cristian G. Jul 10 '13 at 15:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.