LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > sumeet inani
User Name
Password

Notices


Rate this Entry

dos programming

Posted 03-27-2011 at 05:56 AM by sumeet inani
Updated 03-28-2011 at 06:20 AM by sumeet inani

This is about scheduling download on remote vista machine via telnet.

I wanted to give link , file name & time as input to script which will start background process executing batch file ( created by script ) on schedule.

After an hour I came out with
Code:
Tree
<dir> bat
<dir> log
<dir> done
template.bat
chp.exe
wget.exe
touch.exe


template.bat CODE
:while
set /p name=file name (write end to exit) :-
if %name%==end goto stop
echo cd <folder-containing-batch-files> > bat\%name%.bat
echo <drive-letter>:  >> bat\%name%.bat
set /p link=URL:-
echo wget %link%  -a logs\%name%.log >> bat\%name%.bat
echo touch done\%name%.done    >> bat\%name%.bat
time /t @this is current time
set /p tod=time to schedule job :-
at %tod% <full path of chp.exe> cmd /c <full path of %name%.bat>
goto while
:stop
You can keep feeding links .

I got
touch (http://unxutils.sourceforge.net/)
wget (http://gnuwin32.sourceforge.net/packages/wget.htm)
chp (http://www.commandline.co.uk/chp/)
for vista from unixutils

These applications are crafty. Thanks to developers.

You can use
Code:
(1)'tail' (from unixutils) of logfile to know ETA 
(2)'if exist <file-1.done> if exist <file-2.done> ... so on ... shutdown /s' to automatically turn off computer after all files have been downloaded.
Posted in Uncategorized
Views 4131 Comments 1
« Prev     Main     Next »
Total Comments 1

Comments

  1. Old Comment
    Code:
    template
    file name (write end to exit) :-fn2
    URL:-http://download843.mediafire.com/gnyvblcgnrmg/cexz23f5t9s3t1b/Finding+Nemo+-+Sha2lba.Com_By_Sam.part2.rar
    03:59 PM
    time to schedule job :-16:00
    Added a new job with job ID = 24
    file name (write end to exit) :-fn3
    URL:-http://download843.mediafire.com/070j0q671ygg/avmtzv8e3t182vt/Finding+Nemo+-+Sha2lba.Com_By_Sam.part3.rar
    03:59 PM
    time to schedule job :-16:00
    Added a new job with job ID = 25
    file name (write end to exit) :-fn4
    URL:-http://download1334.mediafire.com/8d253gjlg1hg/3a487e6yqin7b54/Finding+Nemo+-+Sha2lba.Com_By_Sam.part4.rar
    03:59 PM
    time to schedule job :-16:01
    Cannot create a file when that file already exists.
    file name (write end to exit) :-end
    I don't understand why fn4.bat did not ran .
    can you spot error in template.bat ?
    Posted 05-17-2011 at 05:33 AM by sumeet inani sumeet inani is offline
 

  



All times are GMT -5. The time now is 02:00 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration