Forum Moderators: phranque

Message Too Old, No Replies

Run in Background

How to make XP run an ftp batch file in the background.

         

Rhys

12:24 am on Jul 21, 2004 (gmt 0)

10+ Year Member



I have a batch file that runs every 15 minutes to send a web-cam pic to my site.
The .pif is set to run "Window Minimised".
When I manually run the shortcut, it's icon appears and stays peacefully on the task bar until it is complete, but when Task Scheduler runs it, it pops up the big black DOS screen and stops me working till it is done. Very counter-productive and ulcer-making.
Clues Please?

gertrijs

7:12 am on Jul 21, 2004 (gmt 0)



Try this:
In your .bat file, where you now have the line

ftp bla bla bla

change that to

start /min ftp bla bla bla

This will start your ftp session in a new minimized command box. The original .bat file will immediately continue to run (probably exit if the 'ft' line was the last line).

Gert

Rhys

8:12 am on Jul 21, 2004 (gmt 0)

10+ Year Member



Thanks - that's a clue, but the ftp bit is the last batch instruction. I need to suppress the screen at the beginning.
Here's the code I'm using....
@echo off
echo aÿ ¦ choice /cÿ /n
echo aÿ ¦ choice /cÿ /n
echo aÿ ¦ choice /cÿ /n
CALL C:\PROGRA~1\IMAGEM~1\test.bat
CHDIR C:\PROGRA~1\IMAGEM~1\
Copy "C:\Program Files\SupervisionCam\Images1\svc_ts.jpg" "C:\Program Files\ImageMagick\images\image.jpg"
mogrify -crop 480x240+145+130 -sharpen 2x0.7 -contrast -font "C:\WINDOWS\FONTS\VERDANA.TTF" -pointsize 18 -fill blue -draw "text 100,20 '@TDATE.TXT'" images/image.jpg
Copy "C:\Program Files\ImageMagick\images\image.jpg" "C:\Documents and Settings\All Users\Desktop\image.jpg"
start /min ftp -s:opotiki.scp opotiki.com

gertrijs

12:09 pm on Jul 21, 2004 (gmt 0)



Just start the entire .bat file using start /min?

Gert

Rhys

11:08 pm on Jul 21, 2004 (gmt 0)

10+ Year Member



Thanks for the input, Gert.
Problem solved anyway:
What happens is this, If you use the browse function in Task Scheduler to point to a shortcut, it tries to be helpful and points itself directly to the required file, thus bypassing the shortcut - this is why the .lnk "Run Minimised" command was being ignored.
To solve this, I had to manually enter the command line thus:
"C:\Program Files\ImageMagick\bin\start.lnk".

Now it starts with the shortcut, and stays minimised.

Running a program from the DOS command with run /min prefix does not inhibit the DOS window from opening at start, an embedded command WILL run minimised.

This is another example of the Windows authors gettng ahead of the user, and actually making it harder to use.