Sign in with
Sign up | Sign in
Your question

Batch file to run prog and output to txt...not working

Last response: in Windows XP
Share
August 4, 2010 5:33:15 AM

I have created a bat that starts tinyget, and it should poll data on a web server, then output that data to a txt. I have tried the command in tinyget and it does get the data and outputs to the file, but when I do it as a bat, it passes no data. In other words, if the file had info in it before, the file is empty after.

I have tried copy, print, echo, etc...and they either error, pass blank info or an error string. Suggestions?

  1. start tinyget -srv:<a href="http://www.domain.org" rel="nofollow" target="_blank">www.domain.org</a> -uri:/ -loop:1 -d > f:\file.txt
August 4, 2010 8:11:58 AM

Try:

  1. start "tinyget -srv:www.domain.org -uri:/ -loop:1 -d > f:\file.txt"


i.e. put quotes round the command string.
m
0
l
August 4, 2010 5:09:10 PM

Ijack said:
Try:

  1. start "tinyget -srv:www.domain.org -uri:/ -loop:1 -d > f:\file.txt"


i.e. put quotes round the command string.


When using that method, running the bat opens a command prompt where the title is what is in quotes. Nothing is executed.

m
0
l
Related resources
August 4, 2010 5:12:11 PM

Put the full path to the program in the batch file, C:\Program Files\Tinyget\tinyget.exe probably.
m
0
l
August 4, 2010 5:31:43 PM

It doesn't like the spaces in Program Files. I tried just putting quotes around just the folder names that have spaces, but that did not work either. It acts like it did something but still no output.
m
0
l
August 4, 2010 7:27:17 PM

OK, next try:

  1. start "tinyget" "tinyget -srv:www.domain.org -uri:/ -loop:1 -d > f:\file.txt"


Sorry - start takes a parameter that I wan't aware of.
m
0
l
August 4, 2010 7:40:20 PM

Ijack said:
OK, next try:

  1. start "tinyget" "tinyget -srv:www.domain.org -uri:/ -loop:1 -d > f:\file.txt"


Sorry - start takes a parameter that I wan't aware of.


m
0
l
August 4, 2010 7:58:45 PM

Oh dear. Do excuse me, but I don't have the tinget program to actually try it with. What happens if you forget about the "start" and just put:
  1. tinyget -srv:www.domain.org -uri:/ -loop:1 -d > f:\file.txt
m
0
l
August 4, 2010 8:24:49 PM

Ijack said:
Oh dear. Do excuse me, but I don't have the tinget program to actually try it with. What happens if you forget about the "start" and just put:
  1. tinyget -srv:www.domain.org -uri:/ -loop:1 -d > f:\file.txt


With this code, it appears to run the bat, but outputs no data to the file.
m
0
l
August 4, 2010 8:35:59 PM

Ah well. Sorry, but I'm all out of ideas for the present. If you still can't find the answer I'll try and get hold of tinyget and have a play with it.
m
0
l
August 5, 2010 1:57:14 PM

mokus said:
With this code, it appears to run the bat, but outputs no data to the file.


Open up a cmd windows, drag the .bat file to it, do you get any messages when you run it that way? Sometimes you need to do that to see any errors that come up.
m
0
l
August 5, 2010 3:38:18 PM

Final attempt. I've now downloaded tinyget, and this works on my system (xp64):

  1. "c:\program files (x86)\iis resources\tinyget\tinyget" -srv:www.domain.org -uri:/ -loop:1 -d >test.dat


So you need the full path to the program and, because that contains spaces, you need to enclose the program name (only) in quotes.
m
0
l
August 5, 2010 3:44:47 PM

Ijack said:
Final attempt. I've now downloaded tinyget, and this works on my system (xp64):

  1. "c:\program files (x86)\iis resources\tinyget\tinyget" -srv:www.domain.org -uri:/ -loop:1 -d >test.dat


So you need the full path to the program and, because that contains spaces, you need to enclose the program name (only) in quotes.


That's correct, because the program is not part of your Path, you need to put the full path windows can find it in. And the arguements to to the program do go ouside the quotes, forgot to mention that when I said to put in the full program path in.
m
0
l
August 10, 2010 2:36:13 AM

I've been busy, but I still want to get back to this and post what worked for me.

  1. C:\"Program Files"\"IIS Resources"\TinyGet\tinyget.exe -srv:www.domain.org -uri:/ -loop:1 -d > f:\file.txt


Thanks for everyone's help!
m
0
l
!