Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

wait copy ftp

851 views
Skip to first unread message

Leon Sharp

unread,
Jul 3, 2012, 11:38:00 PM7/3/12
to
Tryin to create a batch file to wait for a file from a local drive then once the file come in (*.txt) make a copy then ftp it to a server

Thank you in advance,

foxidrive

unread,
Jul 3, 2012, 11:44:42 PM7/3/12
to
On Wednesday 04/07/2012 13:38, Leon Sharp wrote:
> Tryin to create a batch file to wait for a file from a local drive then once the file come in (*.txt) make a copy then ftp it to a server

Google will find you the way to script an FTP transfer.

Your batch file will look like this:

@echo off
:loop

if exist file.txt (
ftp transfer here
)

ping -n 60 localhost >nul
goto :loop





--
Mic


Leon Sharp

unread,
Jul 4, 2012, 12:04:12 AM7/4/12
to
That seems a little to simple!
So I would need to have it wait for the file, which could be several times a day, then copy it to another folder then ftp it out, then finally send me an email stating this was done. I have a copy of a batch i was working on but left it at the office computer.

so lets say the file i am waiting for is c:\temp\file.txt
once that file becomes available I would like to make a copy to c:\temp\backup\file.txt
then ftp that file out to a server \\server.com\filedepot\file.txt
then send me an email that this was successfully done. :/

Thanks in advance

foxidrive

unread,
Jul 4, 2012, 12:20:54 AM7/4/12
to
What did your last slave die of? :)


@echo off
:loop
if exist "c:\temp\file.txt" (
copy command here
ftp transfer here
email command with errorlevel here

JJ

unread,
Jul 4, 2012, 12:39:31 AM7/4/12
to
foxidrive <foxi...@gotcha.woohoo.invalid> wrote:

> @echo off
>:loop
> if exist "c:\temp\file.txt" (
> copy command here
> ftp transfer here
> email command with errorlevel here
> )
> ping -n 60 localhost >nul
> goto :loop

While ftp is available in Windows, email sending is not. I thought I could
find one from cygwin, gnuwin32 or mingw. But they don't seem to have one.
Do you have any suggestion for a command-line email sending?

foxidrive

unread,
Jul 4, 2012, 12:45:06 AM7/4/12
to
Yes, Blat is free.

--
Mic


Leon Sharp

unread,
Jul 5, 2012, 9:08:48 AM7/5/12
to
I use postie...

Todd Vargo

unread,
Jul 5, 2012, 4:40:42 PM7/5/12
to
On 7/4/2012 12:20 AM, foxidrive wrote:
>
> @echo off
> :loop
> if exist "c:\temp\file.txt" (
> copy command here
> ftp transfer here
> email command with errorlevel here
> )
> ping -n 60 localhost >nul
> goto :loop

With no indication of how the file arrives in the folder and although
the file may exist, it may not be finished being written. I would
suggest storing the file size, delay for a period, then check the file
size again before moving on to the copy and other stuff.

--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)


foxidrive

unread,
Jul 5, 2012, 8:43:20 PM7/5/12
to
On Friday 06/07/2012 06:40, Todd Vargo wrote:
> On 7/4/2012 12:20 AM, foxidrive wrote:
>>
>> @echo off
>> :loop
>> if exist "c:\temp\file.txt" (
>> copy command here
>> ftp transfer here
>> email command with errorlevel here
>> )
>> ping -n 60 localhost >nul
>> goto :loop
>
> With no indication of how the file arrives in the folder and although
> the file may exist, it may not be finished being written. I would
> suggest storing the file size, delay for a period, then check the file
> size again before moving on to the copy and other stuff.

True. The OP would know if it is a large file, and a slow transfer like FTP.

If it is a fast file system copy then a simple delay before the copy command would solve that in normal operation.


--
Mic


noel....@gmail.com

unread,
Jul 5, 2012, 9:58:29 PM7/5/12
to
Todd, I forgot about, how about setting up a trigger file? Could that help me? The file will be created locally after a process is ran. Guys I may be asking for a lot, but this is really my first batch file. Any help in setting this up is greatly appreciated. Thanks Foxidrive for your help so far.

@echo off
:loop
if exist "c:\temp\file.txt" (
copy c:\temp\file.txt c:\temp\store\file.txt

::ftp transfer here

::email command with errorlevel here (not sure how to setup with error level)
postie -host:<SMTPSERVER> -to:<TOADDRESS> -from:<FROMADDRESS> -s:"<SUBJECT>" -msg:"file.txt has been ftp'd"

)
ping -n 60 localhost >nul
goto :loop

What you think almost getting there? :/

foxidrive

unread,
Jul 5, 2012, 10:36:14 PM7/5/12
to
On Friday 06/07/2012 11:58, noel....@gmail.com wrote:
> Todd, I forgot about, how about setting up a trigger file? Could that help me? The file will be created locally after a process is ran. Guys I may be asking for a lot, but this is really my first batch file. Any help in setting this up is greatly appreciated. Thanks Foxidrive for your help so far.
>
>
> What you think almost getting there? :/

Here's a bit more meat - Untested:

FTP.EXE doesn't return errorlevels so you will need to check the log file to see if the transfer succeeded.
If there is specific text showing that it succeeded then you can check that using FIND.EXE and modify the message being sent.


@echo off
set server_name=FTP.server.name
set username=username
set password=password
set remote_directory=/folder/abc/def
set "filename=c:\temp\file.txt"
set "target=c:\temp\store\"

:loop
if exist "%filename%" (
ping -n 60 localhost >nul
copy /b "%filename%" "%target%"

rem ftp transfer here
(
echo open %server_name%
echo %username%
echo %password%
echo cd %remote_directory%
echo put "%filename%"
echo quit
)>list.ftp

echo %date% %time% >>ftp.log
echo ========================= >>ftp.log
FTP -s:list.ftp >>ftp.log
echo ========================= >>ftp.log


rem email command with errorlevel here (not sure how to setup with error level)
postie -host:<SMTPSERVER> -to:<TOADDRESS> -from:<FROMADDRESS> -s:"<SUBJECT>" -msg:"%filename% has been ftp'd'"

del list.ftp 2>nul

)
ping -n 60 localhost >nul
goto :loop





--
Mic


noel....@gmail.com

unread,
Jul 5, 2012, 9:44:54 PM7/5/12
to
Todd, I forgot about, how about setting up a trigger file? Could that help me? The file will be created locally after a process is ran. Guys I may be asking for a lot, but this is really my first batch file. Any help in setting this up is greatly appreciated. Thanks Foxidrive for your help so far.

@echo off
:loop
if exist "c:\temp\file.txt" (
copy c:\temp\file.txt c:\temp\store\file.txt

::ftp transfer here

::email command with errorlevel here (not sure how to setup with error level)
postie -host:<SMTPSERVER> -to:<TOADDRESS> -from:<FROMADDRESS> -s:"<SUBJECT>" -msg:"file.txt has been ftp'd"

)
ping -n 60 localhost >nul
goto :loop

Leon Sharp

unread,
Jul 5, 2012, 11:16:23 PM7/5/12
to
I will test this first thing in the morning THANK YOU.

Zaidy036

unread,
Jul 6, 2012, 11:15:11 AM7/6/12
to
Leon Sharp <leonsh...@gmail.com> wrote:
> I will test this first thing in the morning THANK YOU.

Task manager should have an FTB process that can be checked for and watched
for completion.

Petr Laznovsky

unread,
Jul 6, 2012, 5:04:35 PM7/6/12
to

Leon Sharp

unread,
Jul 6, 2012, 10:01:13 PM7/6/12
to
Zaidy036, i dont understand.

Todd Vargo

unread,
Jul 6, 2012, 10:42:05 PM7/6/12
to
On 7/5/2012 9:44 PM, noel....@gmail.com wrote:
> On Thursday, July 5, 2012 4:40:42 PM UTC-4, Todd Vargo wrote:
>> On 7/4/2012 12:20 AM, foxidrive wrote:
>>>
>>> @echo off
>>> :loop
>>> if exist "c:\temp\file.txt" (
>>> copy command here
>>> ftp transfer here
>>> email command with errorlevel here
>>> )
>>> ping -n 60 localhost >nul
>>> goto :loop
>>
>> With no indication of how the file arrives in the folder and although
>> the file may exist, it may not be finished being written. I would
>> suggest storing the file size, delay for a period, then check the file
>> size again before moving on to the copy and other stuff.
>>
>> --
>> Todd Vargo
>> (Post questions to group only. Remove "z" to email personal messages)
>
> Todd, I forgot about, how about setting up a trigger file? Could that help me? The file will be created locally after a process is ran.

Sure, that will be fine and eliminates guessing if the target file is
complete. So how is the target file being created? That may indicate if
a trigger file is even needed.

Leon Sharp

unread,
Jul 6, 2012, 11:37:40 PM7/6/12
to
On Friday, July 6, 2012 10:42:05 PM UTC-4, Todd Vargo wrote:
The file is being created from a process a user runs to create the file. The file is placed in the c:\temp folder. Its a pretty small file and its a .txt file.

Timo Salmi

unread,
Jul 7, 2012, 2:28:47 AM7/7/12
to
On 07.07.2012 00:04 Petr Laznovsky <nob...@nowhere.com> wrote:
> http://retired.beyondlogic.org/solutions/cmdlinemail/cmdlinemail.htm

Interesting. But the file is flagged by Avira antivirus. "Contains
recognition pattern of the SPR/Emailer program".

All the best, Timo

--
Prof. (emer.) Timo Salmi, Vaasa, Finland.
http://www.netikka.net/tsneti/homepage.php

foxidrive

unread,
Jul 7, 2012, 3:01:48 AM7/7/12
to
On Saturday 07/07/2012 16:28, Timo Salmi wrote:
> On 07.07.2012 00:04 Petr Laznovsky <nob...@nowhere.com> wrote:
>> http://retired.beyondlogic.org/solutions/cmdlinemail/cmdlinemail.htm
>
> Interesting. But the file is flagged by Avira antivirus. "Contains
> recognition pattern of the SPR/Emailer program".
>

The Avira forum is not very descriptive and don't say it is malware or not, just that it will not be reclassified.
http://forum.avira.com/wbb/index.php?page=Thread&threadID=128188


But many command line tools are flagged as malware these days: cmdow is one that is flagged as malware and I've had many others that I know are not malware - just that they can be used in tricky ways, as CMDOW can launch hidden windows etc.

The AV industry thrives on scaring people, hence the huge banners. They want people to buy the full product.


--
Mic


JJ

unread,
Jul 7, 2012, 3:24:09 AM7/7/12
to
Timo Salmi <t...@uwasa.fi> wrote:

> Interesting. But the file is flagged by Avira antivirus. "Contains
> recognition pattern of the SPR/Emailer program".

Well, it IS an emailer after all. Most antiviruses would catch it due to
hueristic scanning. It's smart for detecting what a program can do, but it
doesn't know s**t whether a program is legit or not. The reason why they
don't flag Thunderbird (or any other popular programs) is because they
have a database of known legit programs.

Timo Salmi

unread,
Jul 7, 2012, 3:36:21 AM7/7/12
to
On 07.07.2012 10:01 foxidrive wrote:
> On Saturday 07/07/2012 16:28, Timo Salmi wrote:
>> On 07.07.2012 00:04 Petr Laznovsky <nob...@nowhere.com> wrote:
>>> http://retired.beyondlogic.org/solutions/cmdlinemail/cmdlinemail.htm

>> Interesting. But the file is flagged by Avira antivirus. "Contains
>> recognition pattern of the SPR/Emailer program".

> The Avira forum is not very descriptive and don't say it is malware
> or not, just that it will not be reclassified.
> http://forum.avira.com/wbb/index.php?page=Thread&threadID=128188

This is not an insurmountable problem as such, since the scanner
accepts user's exceptions.

> But many command line tools are flagged as malware these days: cmdow
> is one that is flagged as malware and I've had many others that I
> know are not malware

The problem here is that since many scanners have the same (potential,
I'm not taking a stand) false positives, email sent by such a program is
likely to be rejected at the receiver's end by his/her ISP's scanners.

(Although this sideline is virus related, the discussion also relates to
command line tools and is thus on topic.)

All the best, Timo

--
Prof. (emer.) Timo Salmi, Vaasa, Finland.
http://www.netikka.net/tsneti/homepage.php
CMD script tricks http://www.netikka.net/tsneti/info/tscmd.php

Todd Vargo

unread,
Jul 7, 2012, 8:07:57 AM7/7/12
to
On 7/6/2012 11:37 PM, Leon Sharp wrote:
> On Friday, July 6, 2012 10:42:05 PM UTC-4, Todd Vargo wrote:
>>
>> Sure, that will be fine and eliminates guessing if the target file is
>> complete. So how is the target file being created? That may indicate if
>> a trigger file is even needed.
>
> The file is being created from a process a user runs to create the file. The file is placed in the c:\temp folder. Its a pretty small file and its a .txt file.

The rabbit hole keeps leading us down an ever opaque discussion.

foxidrive

unread,
Jul 7, 2012, 8:13:11 AM7/7/12
to
On Saturday 07/07/2012 22:07, Todd Vargo wrote:
> On 7/6/2012 11:37 PM, Leon Sharp wrote:
>> On Friday, July 6, 2012 10:42:05 PM UTC-4, Todd Vargo wrote:
>>>
>>> Sure, that will be fine and eliminates guessing if the target file is
>>> complete. So how is the target file being created? That may indicate if
>>> a trigger file is even needed.
>>
>> The file is being created from a process a user runs to create the file. The file is placed in the c:\temp folder. Its a pretty small file and its a .txt file.
>
> The rabbit hole keeps leading us down an ever opaque discussion.
>

I think the question should be: does it take longer than 10 seconds to create the file?


The code I posted delays for 60 seconds after detecting the file so it should be an ample delay.


--
Mic


Frank P. Westlake

unread,
Jul 7, 2012, 9:14:45 AM7/7/12
to
On 2012-07-07 00:36, Timo Salmi wrote:
> (Although this sideline is virus related, the discussion also relates to
> command line tools and is thus on topic.)

You're initial warning is very much on topic and I thank you for going
to the trouble.

Frank

Zaidy036

unread,
Jul 7, 2012, 11:25:10 AM7/7/12
to
Sorry, using an iPad while traveling and a typo.

I would look for two things for what you are trying (ftp) but not sure if
either are usable:
1. Use Start /Wait command for ftp
2. Watch Task Manager to see if a process is running during ftp that can
then be watched for completion. On a time delay basis using TIMEOUT

Petr Laznovsky

unread,
Jul 7, 2012, 3:33:19 PM7/7/12
to
+1

The program is 17kb size, and did his job well. I can`t realize how
somebody put some additonal evil code inside ;-)

L.

Timo Salmi

unread,
Jul 8, 2012, 1:42:53 AM7/8/12
to
On 07.07.2012 00:04 Petr Laznovsky wrote:
>> Do you have any suggestion for a command-line email sending?
> http://retired.beyondlogic.org/solutions/cmdlinemail/cmdlinemail.htm

Of related interest. Have not tried it, though.
http://www.lewisroberts.com/2006/06/09/sending-cdomessage-with-importance/

All the best, Timo

--
Prof. (emer.) Timo Salmi, Vaasa, Finland
http://www.netikka.net/tsneti/homepage.php
Useful CMD script tricks http://www.netikka.net/tsneti/info/tscmd.php

Petr Laznovsky

unread,
Jul 8, 2012, 5:41:13 PM7/8/12
to
On 4.7.2012 6:39, JJ wrote:
Another one:

http://www.muquit.com/muquit/software/mailsend/mailsend.html


Todd Vargo

unread,
Jul 8, 2012, 6:36:53 PM7/8/12
to
I would like to determine if the unknown process that creates the file
can be wrapped in a script. ISTM, a wrapper would be preferable (if
possible) to leaving a separate batch process running all day. Once the
wrapper option is ruled out, I would then pursue the latter.

BTW, look at the code you posted again. Although OP wanted to COPY the
file to another location, the original file should be MOVEd or deleted.
If you do not remove the file from the original location, the loop will
copy/ftp the same file indefinitely, not only wasting cpu time, but
internet bandwidth as well.

Leon Sharp

unread,
Jul 8, 2012, 8:35:27 PM7/8/12
to
Foxidrive 60 seconds is great. Going to finally test this out. Thanks for your help so far.

foxidrive

unread,
Jul 9, 2012, 12:26:33 AM7/9/12
to
On Monday 09/07/2012 08:36, Todd Vargo wrote:

> BTW, look at the code you posted again. Although OP wanted to COPY the
> file to another location, the original file should be MOVEd or deleted.

Deleted after FTP I expect.

> If you do not remove the file from the original location, the loop will
> copy/ftp the same file indefinitely, not only wasting cpu time, but
> internet bandwidth as well.

Good point and well spotted. :)



--
Mic


Leon Sharp

unread,
Jul 9, 2012, 3:59:57 PM7/9/12
to
Did I say copy... of course I meant move!! ;) testing now... i'll get back at ya.

Thanks

Todd Vargo

unread,
Jul 9, 2012, 6:26:29 PM7/9/12
to
Better stick with adding the delete after ftp. Otherwise, if you replace
COPY with MOVE, you will either have to move it after the ftp or make
several other modifications for the ftp to work.

Leon Sharp

unread,
Jul 9, 2012, 9:40:03 PM7/9/12
to
Todd, yup changed the copy to move. Thinking of adding another value to add date and or time to be able to keep the file but I ll double check if I need to keep it I may not have to which will make it much easier to just delete after FTP. I tested today seems to work okay I keep getting an error while doing the FTP portion. I ll test again and post log.

Thanks all for your input and help. I hope to help others as you helped me. I ll update post tomorrow.

JJ

unread,
Jul 10, 2012, 2:15:17 AM7/10/12
to
Timo Salmi <t...@uwasa.fi> wrote:

> Of related interest. Have not tried it, though.
> http://www.lewisroberts.com/2006/06/09/sending-cdomessage-with-importa
> nce/

That's *very* interesting. I didn't realize Windows actually has an email
library that doesn't need MAPI. It's probably part of IIS. It funny
though, the DLL use one of Outlook Express DLL file.

foxidrive

unread,
Jul 10, 2012, 2:52:37 AM7/10/12
to
Win 7 doesn't have OE any longer.

I had this saved - just tested it in Win 7 and it works.


::bat-email.cmd:::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
setlocal
set vbsfile=bat-email.vbs
call :createVBS

:: defaults
set From=m...@here.com.au
set To=y...@lavabit.com
set Subj="email test %date% %time%"
set Body="did it work? %date% %time%"
set Serv=mail.server.com.au
set Auth=user
set Pass=pass

call :send %From% %To% %Subj% %Body% %Serv% %Auth% %Pass%
pause
goto :EOF

:send
cscript.exe %vbsfile% %1 %2 %3 %4 %5 %6 %7
goto :EOF

:createVBS
del %vbsfile% 2>nul
set cdoSchema=http://schemas.microsoft.com/cdo/configuration
echo >>%vbsfile% Set objArgs = WScript.Arguments
echo >>%vbsfile% Set objEmail = CreateObject("CDO.Message")
echo >>%vbsfile% objEmail.From = objArgs(0)
echo >>%vbsfile% objEmail.To = objArgs(1)
echo >>%vbsfile% objEmail.Subject = objArgs(2)
echo >>%vbsfile% objEmail.Textbody = objArgs(3)
echo >>%vbsfile% ' objEmail.AddAttachment "%~f0"
echo >>%vbsfile% with objEmail.Configuration.Fields
echo >>%vbsfile% .Item ("%cdoSchema%/sendusing") = 2 ' not local, smtp
echo >>%vbsfile% .Item ("%cdoSchema%/smtpserver") = objArgs(4)
echo >>%vbsfile% .Item ("%cdoSchema%/smtpserverport") = 25
echo >>%vbsfile% .Item ("%cdoSchema%/smtpauthenticate") = 1 ' cdobasic
echo >>%vbsfile% .Item ("%cdoSchema%/sendusername") = objArgs(5)
echo >>%vbsfile% .Item ("%cdoSchema%/sendpassword") = objArgs(6)
echo >>%vbsfile% .Item ("%cdoSchema%/smtpusessl") = False
echo >>%vbsfile% .Item ("%cdoSchema%/smtpconnectiontimeout") = 25
echo >>%vbsfile% .Update
echo >>%vbsfile% end with
echo >>%vbsfile% objEmail.Send


--
Mic


Timo Salmi

unread,
Jul 10, 2012, 10:43:23 AM7/10/12
to
On 10.07.2012 09:52 foxidrive wrote:
> I had this saved - just tested it in Win 7 and it works.
> ::bat-email.cmd:::::::::::::::::::::::::::::::::::::::::::::::::::::
> @echo off
> setlocal
> set vbsfile=bat-email.vbs
> call :createVBS
(snip)
> :createVBS
> del %vbsfile% 2>nul
> set cdoSchema=http://schemas.microsoft.com/cdo/configuration
> echo >>%vbsfile% Set objArgs = WScript.Arguments
(snip)
> echo >>%vbsfile% objEmail.Send

Well done! Works for me, too. One small, but necessary correction, at
least on my XP PC. The :creatVBS subroutine must be concluded with

goto :EOF

foxidrive

unread,
Jul 10, 2012, 11:40:52 AM7/10/12
to
On Wednesday 11/07/2012 00:43, Timo Salmi wrote:
> On 10.07.2012 09:52 foxidrive wrote:
>> I had this saved - just tested it in Win 7 and it works.
>> ::bat-email.cmd:::::::::::::::::::::::::::::::::::::::::::::::::::::
>> @echo off
>> setlocal
>> set vbsfile=bat-email.vbs
>> call :createVBS
> (snip)
>> :createVBS
>> del %vbsfile% 2>nul
>> set cdoSchema=http://schemas.microsoft.com/cdo/configuration
>> echo >>%vbsfile% Set objArgs = WScript.Arguments
> (snip)
>> echo >>%vbsfile% objEmail.Send
>
> Well done! Works for me, too. One small, but necessary correction, at
> least on my XP PC. The :creatVBS subroutine must be concluded with
>
> goto :EOF

Is that right at the end of the file? The end of the file is an implied GOTO :EOF but it won't hurt if you add it.
Did you see some odd behaviour?



I added the del "%vbsfile%" below otherwise it leaves the VBS script laying around.

call :send %From% %To% %Subj% %Body% %Serv% %Auth% %Pass%
pause
del "%vbsfile%"
goto :EOF



--
Mic


Timo Salmi

unread,
Jul 10, 2012, 12:20:30 PM7/10/12
to
On 10.07.2012 18:40 foxidrive wrote:
> On Wednesday 11/07/2012 00:43, Timo Salmi wrote:
>>> echo >>%vbsfile% objEmail.Send
>> Well done! Works for me, too. One small, but necessary correction, at
>> least on my XP PC. The :creatVBS subroutine must be concluded with
>>
>> goto :EOF
>
> Is that right at the end of the file? The end of the file is an implied GOTO :EOF but it won't hurt if you add it.
> Did you see some odd behaviour?

Yes, I actually did. The VBS script did not come out complete. The XP
script failed to take the implied :EOF as an implied end of the
subroutine. It hung.

> I added the del "%vbsfile%" below otherwise it leaves the VBS script laying around.

Already noticed that. I am currently writing a more involved, customized
shell for my own private use around the sending method you posted and
some of what I've found on the net. Thanks for the very useful "kernel".

Leon Sharp

unread,
Jul 10, 2012, 1:16:53 PM7/10/12
to
On Monday, July 9, 2012 6:26:29 PM UTC-4, Todd Vargo wrote:
> On 7/9/2012 3:59 PM, Leon Sharp wrote:
> &gt; On Monday, July 9, 2012 12:26:33 AM UTC-4, foxidrive wrote:
> &gt;&gt; On Monday 09/07/2012 08:36, Todd Vargo wrote:
> &gt;&gt;
> &gt;&gt;&gt; BTW, look at the code you posted again. Although OP wanted to COPY the
> &gt;&gt;&gt; file to another location, the original file should be MOVEd or deleted.
> &gt;&gt;
> &gt;&gt; Deleted after FTP I expect.
> &gt;&gt;
> &gt;&gt;&gt; If you do not remove the file from the original location, the loop will
> &gt;&gt;&gt; copy/ftp the same file indefinitely, not only wasting cpu time, but
> &gt;&gt;&gt; internet bandwidth as well.
> &gt;&gt;
> &gt;&gt; Good point and well spotted. :)
> &gt;&gt;
> &gt;&gt;
> &gt;&gt;
> &gt;&gt; --
> &gt;&gt; Mic
> &gt;
> &gt; Did I say copy... of course I meant move!! ;) testing now... i&#39;ll get back at ya.
>
> Better stick with adding the delete after ftp. Otherwise, if you replace
> COPY with MOVE, you will either have to move it after the ftp or make
> several other modifications for the ftp to work.
>
> --
> Todd Vargo
> (Post questions to group only. Remove &quot;z&quot; to email personal messages)

Yup, I kept the copy for now and added the delete after the FTP, so far its working okay. I just need to add some error checking for the email portion and probably add date and time to end of file as well.

JJ

unread,
Jul 11, 2012, 1:19:55 AM7/11/12
to
foxidrive <foxi...@gotcha.woohoo.invalid> wrote:

> Win 7 doesn't have OE any longer.
>
> I had this saved - just tested it in Win 7 and it works.

Nice.
That schema URL is just a configuration right?
It won't actually phone home, I presume.

JJ

unread,
Jul 11, 2012, 1:21:45 AM7/11/12
to
foxidrive <foxi...@gotcha.woohoo.invalid> wrote:

> Win 7 doesn't have OE any longer.

I'm an XP die hard. \(O,o)_

foxidrive

unread,
Jul 11, 2012, 3:30:50 AM7/11/12
to
Yet it works in Win 7 and would suggest that some other mechanism other than OE is involved.



--
Mic


Todd Vargo

unread,
Jul 11, 2012, 4:09:31 PM7/11/12
to
Just goes to show how sloppy Microsoft engineers really are. They omit
the app from the OS but leave its underlying APIs available for malware
exploits and phone home abilities.

--
Todd Vargo

JJ

unread,
Jul 12, 2012, 12:37:25 AM7/12/12
to
Todd Vargo <tlv...@sbcglobal.netz> wrote:

> Just goes to show how sloppy Microsoft engineers really are.
> They omit the app from the OS but leave its underlying APIs
> available for malware exploits and phone home abilities.

I was curious, so I checked Win7. It's still the same - both x86
and x64.

CDOSYS.DLL > INETCOMM.DLL > MSOERT2.DLL

And they say it's more secure. -_-

The only difference is just the branding of MSOERT2.DLL.
WinXP: Microsoft Outlook Express RT Lib
Win7 : Microsoft Windows Mail RT Lib

FYI...

CDOSYS.DLL:
Microsoft CDO for Windows Library
(yeah, very descriptive...)
CDO stands for Collaboration Data Objects. Was OLE Messaging, then
Active Messaging.

INETCOMM.DLL:
Microsoft Internet Messaging API

JJ

unread,
Jul 12, 2012, 12:38:34 AM7/12/12
to
foxidrive <foxi...@gotcha.woohoo.invalid> wrote:

> Yet it works in Win 7 and would suggest that some other
> mechanism other than OE is involved.

Is there any risk for mail sending?

foxidrive

unread,
Jul 12, 2012, 1:57:32 AM7/12/12
to
I don't see any. I doubt Microsoft is sending themselves a copy to check on what I am doing.



--
Mic


Timo Salmi

unread,
Jul 12, 2012, 7:03:32 AM7/12/12
to
On 12.07.2012 07:37 JJ <jaejunks_at@_googlemail_dot._com> wrote:
> CDOSYS.DLL > INETCOMM.DLL > MSOERT2.DLL

I am stuck with my laptop XP SP3 (with IE8) about

Set objEmail = CreateObject("CDO.Message")
producing for the above foxidrive's earlier line:
A dynamic link library (DLL) initialization routine failed.

I don't have the same problem on my desktops. The probable cause is that
on my Laptop the OE is completely broken while on the desktops it is ok.
Now I should obviously reinstall OE on the laptop, but I have no idea
how. It no more comes with IE8 nor is it a separately installable utility.

I have also copied to the laptop C:\WINDOWS\System32\ the files
cdosys.dll inetcomm.dll msoert2.dll from the destops and tried to
regsvr32 them, but I get the a similar DLL errors.

Now what has this to do with batch? The same thing as before. Getting
the command-line batch solution to send the email.

foxidrive

unread,
Jul 12, 2012, 9:10:41 AM7/12/12
to
On Thursday 12/07/2012 21:03, Timo Salmi wrote:
> On 12.07.2012 07:37 JJ <jaejunks_at@_googlemail_dot._com> wrote:
>> CDOSYS.DLL > INETCOMM.DLL > MSOERT2.DLL
>
> I am stuck with my laptop XP SP3 (with IE8) about
>
> Set objEmail = CreateObject("CDO.Message")
> producing for the above foxidrive's earlier line:
> A dynamic link library (DLL) initialization routine failed.
>
> I don't have the same problem on my desktops. The probable cause is that
> on my Laptop the OE is completely broken while on the desktops it is ok.
> Now I should obviously reinstall OE on the laptop, but I have no idea
> how. It no more comes with IE8 nor is it a separately installable utility.
>
> I have also copied to the laptop C:\WINDOWS\System32\ the files
> cdosys.dll inetcomm.dll msoert2.dll from the destops and tried to
> regsvr32 them, but I get the a similar DLL errors.
>
> Now what has this to do with batch? The same thing as before. Getting
> the command-line batch solution to send the email.
>
> All the best, Timo
>

In control panel applet "add-remove programs" select "add\remove windows components" and then select and remove OE, and finally re-add it. Good luck.

--
Mic


Timo Salmi

unread,
Jul 12, 2012, 10:52:11 AM7/12/12
to
On 12.07.2012 16:10 foxidrive wrote:
> On Thursday 12/07/2012 21:03, Timo Salmi wrote:
>> Now I should obviously reinstall OE on the laptop, but I have no
>> idea how. It no more comes with IE8 nor is it a separately
>> installable utility.

> In control panel applet "add-remove programs" select "add\remove
> windows components" and then select and remove OE, and finally re-add
> it. Good luck.

No, no. Now that is exactly what I can not do. Else I would not have had
to ask. What I have here is not a beginner's nor even a mediocre user's
standard problem. The broken OE on the laptop is not on the add/remove
list. Furthermore, I do not have nor know where one can obtain an
installation setup package for OE. Or what essential is still missing to
explain the "A dynamic link library (DLL) initialization routine failed"
also for the regsvr32 inetcomm.dll command.

JJ

unread,
Jul 12, 2012, 12:14:19 PM7/12/12
to
Timo Salmi <t...@uwasa.fi> wrote:

> No, no. Now that is exactly what I can not do. Else I would not
> have had to ask. What I have here is not a beginner's nor even a
> mediocre user's standard problem. The broken OE on the laptop is
> not on the add/remove list. Furthermore, I do not have nor know
> where one can obtain an installation setup package for OE. Or
> what essential is still missing to explain the "A dynamic link
> library (DLL) initialization routine failed" also for the
> regsvr32 inetcomm.dll command.

MSOERT2.DLL is not a COM DLL, so it's not registerable. REGSVR32
would complain about missing DllRegisterServer function.
INETCOMM.DLL and CDOSYS.DLL are a COM DLL. It registers fine in my
XP SP3.

Here's the list of DLLs that is loaded when creating an instance of
CDO object.
ACTIVEDS.DLL
ADSLDPC.DLL
ATL.DLL
CLBCATQ.DLL
COMRES.DLL
CRYPT32.DLL
INETCOMM.DLL
INETRES.DLL
MLANG.DLL
MSASN1.DLL
MSOERT2.DLL
URLMON.DLL
WININET.DLL
WLDAP32.DLL

I haven't checked each of them, so some may not be COM.

foxidrive

unread,
Jul 12, 2012, 12:46:11 PM7/12/12
to
On Friday 13/07/2012 00:52, Timo Salmi wrote:
> On 12.07.2012 16:10 foxidrive wrote:
>> On Thursday 12/07/2012 21:03, Timo Salmi wrote:
>>> Now I should obviously reinstall OE on the laptop, but I have no
>>> idea how. It no more comes with IE8 nor is it a separately
>>> installable utility.
>
>> In control panel applet "add-remove programs" select "add\remove
>> windows components" and then select and remove OE, and finally re-add
>> it. Good luck.
>
> No, no. Now that is exactly what I can not do. Else I would not have had
> to ask. What I have here is not a beginner's nor even a mediocre user's
> standard problem. The broken OE on the laptop is not on the add/remove
> list.

OE is listed in my XP Pro installation in add/remove *windows components*.

> Furthermore, I do not have nor know where one can obtain an
> installation setup package for OE.

It should be on the install cdrom - that is what the add/remove *windows components* is for.

Failing that, you can do a repair install which should restore the system files, or use SFC


--
Mic


Timo Salmi

unread,
Jul 12, 2012, 1:09:28 PM7/12/12
to
On 12.07.2012 19:14 JJ wrote:
> Timo Salmi <t...@uwasa.fi> wrote:
>> No, no. Now that is exactly what I can not do. Else I would not
>> have had to ask.

> Here's the list of DLLs that is loaded when creating an instance of
> CDO object.

Splendid!

(snip)
> INETCOMM.DLL
> INETRES.DLL
(snip)

That (INETRES.DLL) was missing from my laptop's C:\WINDOWS\system32\.

Thank you ever so much. After copying INETRES.DLL from my desktop PC to
the ailing laptop "regsvr32 INETCOMM.DLL" succeeded and so did the
command line email sending also on that PC. Without your list I would
not have been able to solve what was missing from the said laptop.

One gives, one gets!

Timo Salmi

unread,
Jul 12, 2012, 1:27:09 PM7/12/12
to
On 12.07.2012 19:46 foxidrive wrote:
>> No, no. Now that is exactly what I can not do. Else I would not have had
>> to ask. What I have here is not a beginner's nor even a mediocre user's
>> standard problem. The broken OE on the laptop is not on the add/remove
>> list.
>
> OE is listed in my XP Pro installation in add/remove *windows components*.

Yes, yes, yes, but not on the said laptop of mine. Recounting this the
third time(!) one stalling problem on my laptop was the broken OE.

>> Furthermore, I do not have nor know where one can obtain an
>> installation setup package for OE.
> It should be on the install cdrom - that is what the add/remove *windows components* is for.

I do know these things, but I do not have it! I bought the laptop from
the university when I retired. They have an non-CD legitimate
installation system and license of their own from MS.

Having said that. Thank you for your once again ever so keen interest.
It always is a pleasure to discuss and solve batch matters with you.

> Failing that, you can do a repair install which should restore the system files, or use SFC

As you will have seen, my problem was finally solved by finding out the
still one .dll (the fourth, actually) which was missing from my laptop.
Thanks to JJ's list.

foxidrive

unread,
Jul 12, 2012, 1:35:41 PM7/12/12
to
On Friday 13/07/2012 03:27, Timo Salmi wrote:
> Having said that. Thank you for your once again ever so keen interest.
> It always is a pleasure to discuss and solve batch matters with you.
>
>> > Failing that, you can do a repair install which should restore the system files, or use SFC
> As you will have seen, my problem was finally solved by finding out the
> still one .dll (the fourth, actually) which was missing from my laptop.
> Thanks to JJ's list.

Thanks Timo. It was a good stroke of luck that JJ provided the list and allowed an easy solution for the issue. Well done.


--
Mic


Todd Vargo

unread,
Jul 12, 2012, 4:25:51 PM7/12/12
to
Other than infected computers being hijacked to send spam while MS
insists Win7 has no mail program, no.

Timo Salmi

unread,
Jul 12, 2012, 6:35:07 PM7/12/12
to
On 12.07.2012 23:25 Todd Vargo <tlv...@sbcglobal.netz> wrote:
> On 7/12/2012 12:38 AM, JJ wrote:
>> foxidrive <foxi...@gotcha.woohoo.invalid> wrote:
>> Is there any risk for mail sending?

> Other than infected computers being hijacked to send spam while MS
> insists Win7 has no mail program, no.

Delicious sarcasm. Enjoyed.

Seriously, though. I now more or less have all the ingredients for a
possible new FAQ item. How to send email and news messages from the
command line? I am debating with myself whether or not to write such an
item. Not just because it always is tedious to combine the tidbits, but
this time also given the obvious potential for harm.

All the best, Timo

--
Prof. (emer.) Timo Salmi, Vaasa, Finland
http://www.netikka.net/tsneti/homepage.php

Todd Vargo

unread,
Jul 13, 2012, 12:09:59 AM7/13/12
to
On 7/12/2012 6:35 PM, Timo Salmi wrote:
> On 12.07.2012 23:25 Todd Vargo <tlv...@sbcglobal.netz> wrote:
>> On 7/12/2012 12:38 AM, JJ wrote:
>>> foxidrive <foxi...@gotcha.woohoo.invalid> wrote:
>>> Is there any risk for mail sending?
>
>> Other than infected computers being hijacked to send spam while MS
>> insists Win7 has no mail program, no.
>
> Delicious sarcasm. Enjoyed.
>
> Seriously, though. I now more or less have all the ingredients for a
> possible new FAQ item. How to send email and news messages from the
> command line? I am debating with myself whether or not to write such an
> item. Not just because it always is tedious to combine the tidbits, but
> this time also given the obvious potential for harm.

Sometimes I wonder why some requests demand no 3rd party tools be used.

JJ

unread,
Jul 13, 2012, 1:05:17 AM7/13/12
to
foxidrive <foxi...@gotcha.woohoo.invalid> wrote:

> Thanks Timo. It was a good stroke of luck that JJ provided the
> list and allowed an easy solution for the issue. Well done.

It's what I define "troubleshooting":
You know the trouble is around there, so shoot that way until you
eventually hit it.

Leon Sharp

unread,
Jul 13, 2012, 1:04:54 PM7/13/12
to
On Monday, July 9, 2012 12:26:33 AM UTC-4, foxidrive wrote:
> On Monday 09/07/2012 08:36, Todd Vargo wrote:
>
> &gt; BTW, look at the code you posted again. Although OP wanted to COPY the
> &gt; file to another location, the original file should be MOVEd or deleted.
>
> Deleted after FTP I expect.
>
> &gt; If you do not remove the file from the original location, the loop will
> &gt; copy/ftp the same file indefinitely, not only wasting cpu time, but
> &gt; internet bandwidth as well.
>
> Good point and well spotted. :)
>
>
>
> --
> Mic

Quick question, firstly batch is running great I made some modifications with help from the community and beyond. One thing I need assistance in, I added a date and time stamp at the end of my file for backup. So here lies my issue I am using this:

set DateTime=%date:~-10,2%%date:~-7,2%%date:~-4,4%_%time:~-11,2%%time:~-8,2%
COPY /Y "%fname%" "%targetpath%%file%%DateTime%.txt"

results log07132012 119.txt (space in between time and date!)

Though I am getting the results date and time, when time is less than 10 a leading space is inserted. What am I doing wrong or need to do to the above to have it with a leading 0 instead??

Thanks in advance,

Todd Vargo

unread,
Jul 13, 2012, 4:27:43 PM7/13/12
to
Add the following after your SET command to replace the space with a zero.

set "datetime=%datetime: =0%"

BTW, your SET command will be fine as long as it does not get run near
midnight or DST change. If you do need to run near these date/time
changes, the accepted safe practice is to first store date/time into
variables and then operate on the stored variables.

Dr J R Stockton

unread,
Jul 13, 2012, 3:20:27 PM7/13/12
to
In alt.msdos.batch.nt message <4FFF511B...@uwasa.fi>, Fri, 13 Jul
2012 01:35:07, Timo Salmi <t...@uwasa.fi> posted:

>Seriously, though. I now more or less have all the ingredients for a
>possible new FAQ item. How to send email and news messages from the
>command line? I am debating with myself whether or not to write such an
>item. Not just because it always is tedious to combine the tidbits, but
>this time also given the obvious potential for harm.

A command-line routine to read mail and/or news into files would be
safer and might be equally feasible and instructive.

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms and links;
Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

Leon Sharp

unread,
Jul 13, 2012, 11:52:25 PM7/13/12
to
On Friday, July 13, 2012 4:27:43 PM UTC-4, Todd Vargo wrote:
> On 7/13/2012 1:04 PM, Leon Sharp wrote:
> &gt; On Monday, July 9, 2012 12:26:33 AM UTC-4, foxidrive wrote:
> &gt;&gt; On Monday 09/07/2012 08:36, Todd Vargo wrote:
> &gt;&gt;
> &gt;&gt; &amp;gt; BTW, look at the code you posted again. Although OP wanted to COPY the
> &gt;&gt; &amp;gt; file to another location, the original file should be MOVEd or deleted.
> &gt;&gt;
> &gt;&gt; Deleted after FTP I expect.
> &gt;&gt;
> &gt;&gt; &amp;gt; If you do not remove the file from the original location, the loop will
> &gt;&gt; &amp;gt; copy/ftp the same file indefinitely, not only wasting cpu time, but
> &gt;&gt; &amp;gt; internet bandwidth as well.
> &gt;&gt;
> &gt;&gt; Good point and well spotted. :)
> &gt;&gt;
> &gt;&gt;
> &gt;&gt;
> &gt;&gt; --
> &gt;&gt; Mic
> &gt;
> &gt; Quick question, firstly batch is running great I made some modifications with help from the community and beyond. One thing I need assistance in, I added a date and time stamp at the end of my file for backup. So here lies my issue I am using this:
> &gt;
> &gt; set DateTime=%date:~-10,2%%date:~-7,2%%date:~-4,4%_%time:~-11,2%%time:~-8,2%
> &gt; COPY /Y &quot;%fname%&quot; &quot;%targetpath%%file%%DateTime%.txt&quot;
> &gt;
> &gt; results log07132012 119.txt (space in between time and date!)
> &gt;
> &gt; Though I am getting the results date and time, when time is less than 10 a leading space is inserted. What am I doing wrong or need to do to the above to have it with a leading 0 instead??
>
> Add the following after your SET command to replace the space with a zero.
>
> set &quot;datetime=%datetime: =0%&quot;
>
> BTW, your SET command will be fine as long as it does not get run near
> midnight or DST change. If you do need to run near these date/time
> changes, the accepted safe practice is to first store date/time into
> variables and then operate on the stored variables.
>
> --
> Todd Vargo
> (Post questions to group only. Remove &quot;z&quot; to email personal messages)

Thanks Todd So I should do this??

set DateTime=%date:~-10,2%%date:~-7,2%%date:~-4,4%_%time:~-11,2%%time:~-8,2%
set "datetime=%datetime: =0%"
COPY /Y "%fname%" "%targetpath%%file%%DateTime%.txt"

Thanks again, enjoy your weekend.


foxidrive

unread,
Jul 14, 2012, 12:26:54 AM7/14/12
to
On Saturday 14/07/2012 13:52, Leon Sharp wrote:
> Thanks Todd So I should do this??
>
> set DateTime=%date:~-10,2%%date:~-7,2%%date:~-4,4%_%time:~-11,2%%time:~-8,2%
> set "datetime=%datetime: =0%"
> COPY /Y "%fname%" "%targetpath%%file%%DateTime%.txt"
>
> Thanks again, enjoy your weekend.

Todd would probably agree that filenameYYYYMMDD HHMM is a time format that sorts correctly, and similar (same order but you can include - and _ separators etc)


--
Mic


Leon Sharp

unread,
Jul 14, 2012, 12:35:37 AM7/14/12
to
Foxidrive - I agree, but file with a space in it doesn't look good. I don't mind adding a - or _ but nevertheless I still don't want the leading space. I would prefer a 0. Did I add it correctly above?

foxidrive

unread,
Jul 14, 2012, 1:00:19 AM7/14/12
to
On Saturday 14/07/2012 14:35, Leon Sharp wrote:
Did I add it correctly above?

Above, no. But it looked ok in the preceding messages. :P

Easy way to test it - and a few spaces to the string and see what comes out.


--
Mic


Leon Sharp

unread,
Jul 14, 2012, 8:24:05 AM7/14/12
to
I just was unsure if I need to use both set commands and the copy verbatimly as was posted.

Dr J R Stockton

unread,
Jul 14, 2012, 2:45:30 PM7/14/12
to
In alt.msdos.batch.nt message <jtq0bv$9ot$1...@news.albasani.net>, Fri, 13
Jul 2012 16:27:43, Todd Vargo <tlv...@sbcglobal.netz> posted:

>BTW, your SET command will be fine as long as it does not get run near
>midnight or DST change. If you do need to run near these date/time
>changes, the accepted safe practice is to first store date/time into
>variables and then operate on the stored variables.

Or a clock correction which unfortunately sets the seconds back from 59
to 0. Or crossing a time border and telling the computer.

To be safe, in a normal job or sub-job one should read the date & time
no more than once, with new Date() or Now and set the result
into a single variable which is not again changed.

One should only read date and time again if one wants a value
representing a different date/time, and (if it would matter) one should
check that the apparent interval is not negative.

The VBS routine Date should only be used in work in which time is
irrelevant - i.e. a calendar suffices and a clock is not necessary.

In JavaScript, problems of this mature can often be avoided by using
only UTC.

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05.
Website <http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc. : <http://www.merlyn.demon.co.uk/programs/> - see in 00index.htm
Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.

Todd Vargo

unread,
Jul 15, 2012, 3:46:56 PM7/15/12
to
You referred to me in your preceding message but I'm missing your point
here Mic. Care to elucidate?

--
Todd Vargo

foxidrive

unread,
Jul 15, 2012, 4:51:22 PM7/15/12
to
On Monday 16/07/2012 05:46, Todd Vargo wrote:
> On 7/14/2012 1:00 AM, foxidrive wrote:
>> On Saturday 14/07/2012 14:35, Leon Sharp wrote:

> it looked ok in the preceding messages.
>> Easy way to test it - add a few spaces to the string and see what comes out.
>
> You referred to me in your preceding message but I'm missing your point
> here Mic. Care to elucidate?

Re-read it with the fluff and typo removed.

In essence Leon wanted to know if his line would change the space to a zero. I was pointing out that it looked ok (meaning I hadn't tested it but in reading I couldn't see any error in his syntax) and that if he had added some spaces in a string in a variable, and applied that line to the variable, then he'd soon see if they all changed to zeros.

Debugging 101.


--
Mic


foxidrive

unread,
Jul 15, 2012, 5:03:35 PM7/15/12
to
What I meant was "Todd would probably agree that YYYYMMDD HHMM is a better format for sorting than MMDDYYYY HHMM is"

Of course I didn't have to mention you at all, Todd, but the message was addressing you - so I didn't want to simply add my two cents worth and ignore that.



--
Mic


Todd Vargo

unread,
Jul 15, 2012, 7:22:57 PM7/15/12
to
Since the space to zero exchange was only being applied to the variable
containing the date and time components, I did not read your meaning the
way you describe it here.

(And, yes, filenameYYYYMMDD_HHMM is preferred by many for sorting purposes.)

Leon Sharp

unread,
Jul 16, 2012, 8:48:46 PM7/16/12
to
On Sunday, July 15, 2012 5:03:35 PM UTC-4, foxidrive wrote:
> On Saturday 14/07/2012 14:26, foxidrive wrote:
> &gt; On Saturday 14/07/2012 13:52, Leon Sharp wrote:
> &gt;&gt; Thanks Todd So I should do this??
> &gt;&gt;
> &gt;&gt; set DateTime=%date:~-10,2%%date:~-7,2%%date:~-4,4%_%time:~-11,2%%time:~-8,2%
> &gt;&gt; set &quot;datetime=%datetime: =0%&quot;
> &gt;&gt; COPY /Y &quot;%fname%&quot; &quot;%targetpath%%file%%DateTime%.txt&quot;
> &gt;&gt;
> &gt;&gt; Thanks again, enjoy your weekend.
> &gt;
> &gt; Todd would probably agree that filenameYYYYMMDD HHMM is a time format that sorts correctly, and similar (same order but you can include - and _ separators etc)
>
> What I meant was &quot;Todd would probably agree that YYYYMMDD HHMM is a better format for sorting than MMDDYYYY HHMM is&quot;
>
> Of course I didn&#39;t have to mention you at all, Todd, but the message was addressing you - so I didn&#39;t want to simply add my two cents worth and ignore that.
>
>
>
> --
> Mic

Just for education purposes whats a "trigger file" and how would I use that?

Thanks

Todd Vargo

unread,
Jul 16, 2012, 10:18:48 PM7/16/12
to
On 7/16/2012 8:48 PM, Leon Sharp wrote:
>
> Just for education purposes whats a "trigger file" and how would I use that?

The trigger file as suggested by noel.vega1 (whom I thought was you) is
more commonly referred to as a flag file, is a file that would be
created after a large file or process is complete as an indicator, or
flag, that the operation is finished. The process that creates the file
would also have to create the the flag file.

Unfortunately, you are not furnishing any details about the so-called
process that creates the file in question, so not much else to suggest here.

--
Todd Vargo

richard.w...@gmail.com

unread,
Jul 18, 2012, 12:06:33 PM7/18/12
to
On Tuesday, July 3, 2012 11:38:00 PM UTC-4, Leon Sharp wrote:
> Tryin to create a batch file to wait for a file from a local drive then once the file come in (*.txt) make a copy then ftp it to a server
>
> Thank you in advance,

A very simple script in biterscripting could do

# Script code.
while (true)
do
script SS_FTPUpload.txt ftpserver("ftp.server.com") ftplogin("login") ftppassword("password") localpath ("C:/Path/to/text/files") remotepath("/upload_folder")
system del "C:/Path/to/text/files/*"
sleep (60*60) # 1 hour
done

Every hour will upload all .txt files in folder C:/Path/to/text/files to the server.

"ftp.server.com" is the ftp address of your server.
"login" is the FTP login.
"password" is the pFTP password.
"C:/Path/to/text/files" is where the text files will be created.
"/upload_folder" is where the text files will be uploaded to.

ENCLOSE ALL VALUES/PATHS/LOGIN/PASSWORD IN DOUBLE QUOTES.

Hope this helps.

foxidrive

unread,
Jul 18, 2012, 12:25:11 PM7/18/12
to
It doesn't wait for a file to exist, and be complete before FTPing.
It also doesn't make a copy to another location.

Is there a typo here? "SS_FTPUpload.txt"


I'd like to say welcome to the group Richard - the off-topic scripting post shouldn't be too unwelcome.


--
Mic


Timo Salmi

unread,
Aug 24, 2012, 1:48:11 AM8/24/12
to
foxidrive <foxi...@gotcha.woohoo.invalid> wrote on 12.07.2012 20:35:
> On Friday 13/07/2012 03:27, Timo Salmi wrote:
>> Having said that. Thank you for your once again ever so keen
>> interest. It always is a pleasure to discuss and solve batch
>> matters with you.

> Thanks Timo. It was a good stroke of luck that JJ provided the list
> and allowed an easy solution for the issue. Well done.

Foxidrive in particular. You'll recall this thread and our discussion on
sending email and news postings through command line. I noticed that
there is a similar thread now on Computer Hope's forum
http://www.computerhope.com/forum/index.php/topic,132965.0.html

Just before you posted there your solution, I posted a reference to
the FAQ item
188} How can I send email or newsgroup messages from the command-line?
http://www.netikka.net/tsneti/info/tscmd188.php

That posting has been removed, obviously by Computer Hope's moderation,
and my posting privileges withdraw without any note or warning. I feel,
especially in the face of the effort you and I put into the item, that
such disregard of giving any notice is both unfair and unprofessional
from Computer Hope. I wrote them a note to that effect. But I don't have
high hopes.

All the best, Timo

--
Prof. (emer.) Timo Salmi, Vaasa, Finland
http://www.netikka.net/tsneti/homepage.php

foxidrive

unread,
Aug 24, 2012, 2:30:03 AM8/24/12
to
On Friday 24/08/2012 15:48, Timo Salmi wrote:
> foxidrive <foxi...@gotcha.woohoo.invalid> wrote on 12.07.2012 20:35:
>> On Friday 13/07/2012 03:27, Timo Salmi wrote:
>>> Having said that. Thank you for your once again ever so keen
>>> interest. It always is a pleasure to discuss and solve batch
>>> matters with you.
>
>> Thanks Timo. It was a good stroke of luck that JJ provided the list
>> and allowed an easy solution for the issue. Well done.
>
> Foxidrive in particular. You'll recall this thread and our discussion on
> sending email and news postings through command line. I noticed that
> there is a similar thread now on Computer Hope's forum
> http://www.computerhope.com/forum/index.php/topic,132965.0.html
>
> Just before you posted there your solution, I posted a reference to
> the FAQ item
> 188} How can I send email or newsgroup messages from the command-line?
> http://www.netikka.net/tsneti/info/tscmd188.php
>
> That posting has been removed, obviously by Computer Hope's moderation,
> and my posting privileges withdraw without any note or warning. I feel,
> especially in the face of the effort you and I put into the item, that
> such disregard of giving any notice is both unfair and unprofessional
> from Computer Hope. I wrote them a note to that effect. But I don't have
> high hopes.

That's an unreasonable action by computer hope. Do they expect that no links are posted to other resources on the internet?

I hope you get some sense out them, Timo.


--
Mic

frank.w...@gmail.com

unread,
Aug 24, 2012, 7:02:14 AM8/24/12
to
"It looks dangerous, what do you think it is?"

"I don't know!"

"Shoot it!"

BANG

"Let's go see what it is."

"It's a baby!"

foxidrive

unread,
Aug 27, 2012, 4:52:56 AM8/27/12
to
On Friday 24/08/2012 15:48, Timo Salmi wrote:

> Foxidrive in particular. You'll recall this thread and our discussion on
> sending email and news postings through command line. I noticed that
> there is a similar thread now on Computer Hope's forum
> http://www.computerhope.com/forum/index.php/topic,132965.0.html

Did you note that your URL has been mentioned and quoted in the thread now?

Have you had a response from the mods?



--
Mic

Timo Salmi

unread,
Aug 27, 2012, 8:06:19 AM8/27/12
to
foxidrive wrote:
> On Friday 24/08/2012 15:48, Timo Salmi wrote:
>> Foxidrive in particular. You'll recall this thread and our discussion on
>> sending email and news postings through command line. I noticed that
>> there is a similar thread now on Computer Hope's forum
>> http://www.computerhope.com/forum/index.php/topic,132965.0.html

> Did you note that your URL has been mentioned and quoted in the thread now?

Yes, I did. At least that's good. Thank you both.

> Have you had a response from the mods?

No. So, I also wrote to Computer Hope's webmaster and legal department.
Nothing so far.

foxidrive

unread,
Aug 27, 2012, 7:00:11 PM8/27/12
to
On Monday 27/08/2012 22:06, Timo Salmi wrote:
> foxidrive wrote:
>> On Friday 24/08/2012 15:48, Timo Salmi wrote:
>>> Foxidrive in particular. You'll recall this thread and our discussion on
>>> sending email and news postings through command line. I noticed that
>>> there is a similar thread now on Computer Hope's forum
>>> http://www.computerhope.com/forum/index.php/topic,132965.0.html
>
>> Did you note that your URL has been mentioned and quoted in the thread now?
>
> Yes, I did. At least that's good. Thank you both.
>
>> Have you had a response from the mods?
>
> No. So, I also wrote to Computer Hope's webmaster and legal department.
> Nothing so far.

You could point out that the same information was presented in the thread by two other posters, so WTF have they selected you for hanging and flogging?


--
Mic

Timo Salmi

unread,
Aug 27, 2012, 11:48:23 PM8/27/12
to
Below is the email I sent them. I am not going to bother myself further
with them. In my world of science blunt disregard of a person's
contribution is considered the worst possible conceivable form. A
moderator of worldwide public forum should not be overly much
removed from common courtesy standards. But each to his/her own.

If I want another public forum besides this, I'll continue with
http://stackoverflow.com/

Gentlemen,

I am a new user to Computer Hope. I registered 23-08-2012, 14:17:09. I
noticed that there is a familiar thread on Computer Hope's forum
http://www.computerhope.com/forum/index.php/topic,132965.0.html
It is an e.g. Windows XP script subject on which I have done some free,
public work myself. I posted a reference to the FAQ item I have written
on the subject
188} How can I send email or newsgroup messages from the command-line?
http://www.netikka.net/tsneti/info/tscmd188.php

That posting has been removed, obviously by Computer Hope's moderation,
and my posting privileges withdraw without any notice or warning
whatsoever. I feel, especially in the face of the effort that I (and a
net-friend [foxidrive, who is duly allowed to post]) have put into the
item, that such disregard of giving notice to me is both unfair and
unprofessional from Computer Hope. Your editing decisions are your own,
but kindly have the courtesy of at least informing me about your
decision and its reasons.

Yours sincerely,

--
Prof. (emer.) Timo Salmi
http://www.netikka.net/tsneti/homepage.php
Retired fully served from the University of Vaasa, Finland

foxidrive

unread,
Aug 28, 2012, 12:19:20 AM8/28/12
to
On Tuesday 28/08/2012 13:48, Timo Salmi wrote:
> foxidrive wrote:
>> On Monday 27/08/2012 22:06, Timo Salmi wrote:
>>> foxidrive wrote:
>>>> On Friday 24/08/2012 15:48, Timo Salmi wrote:
>>>>> Foxidrive in particular. You'll recall this thread and our discussion on
>>>>> sending email and news postings through command line. I noticed that
>>>>> there is a similar thread now on Computer Hope's forum
>>>>> http://www.computerhope.com/forum/index.php/topic,132965.0.html
>>>> Did you note that your URL has been mentioned and quoted in the thread now?
>>> Yes, I did. At least that's good. Thank you both.
>>>
>>>> Have you had a response from the mods?
>>> No. So, I also wrote to Computer Hope's webmaster and legal department.
>>> Nothing so far.
>
>> You could point out that the same information was presented in the
>> thread by two other posters, so WTF have they selected you for hanging
>> and flogging?
>
> Below is the email I sent them. I am not going to bother myself further
> with them. In my world of science blunt disregard of a person's
> contribution is considered the worst possible conceivable form. A
> moderator of worldwide public forum should not be overly much
> removed from common courtesy standards. But each to his/her own.

ok, you're quite reasonable, and I would suggest that a recent signup and the posting of a URL is what triggered the Mod.

Some places disallow posting of a URL until you're known in the forum.

> If I want another public forum besides this, I'll continue with
> http://stackoverflow.com/

Okies.



--
Mic
0 new messages