Home All Groups Group Topic Archive Search About
Author
16 Dec 2008 2:30 PM
stevenjansen
Hello, Who can make a batchfile with de following tasks: - A program on my computer will open the batchfile - The batchfile wil sleep "X" seconds - After sleeping the batchfile will rename a other file that stay in the same map of de batchfile. De name of that file must be: movie_1_YYYYMMDD_HHMMSS.wmv YYYYMMDD refert to de date of the moment that de batchfile is running HHMMSS refert to de time of the moment that de batchfile is running (Example: When i run the batch file on 2008-12-16 and on time 16:02:57, the name of the file that must be renamed is: movie_1_20081206_160257.wmv  and must be renamed in movie.wmv) De file must be renamed to "movie.wmv". After renaming the fill must be uploaded with a FTP script And after uploading the file must be deleting in de local folder (NOT! on the ftp server). After deleting, the batch is finish. So who can make some script? :-) Steven -- stevenjansen ------------------------------------------------------------------------ stevenjansen's Profile: http://forums.techarena.in/members/stevenjansen.htm View this thread: http://forums.techarena.in/server-scripting/1088584.htmhttp://forums.techarena.in

Author
16 Dec 2008 3:34 PM
Pegasus (MVP)
Show quote Hide quote
"stevenjansen" <stevenjansen.3kiozc@DoNotSpam.com> wrote in message
news:stevenjansen.3kiozc@DoNotSpam.com...
>
> Hello,
>
> Who can make a batchfile with de following tasks:
>
> - A program on my computer will open the batchfile
> - The batchfile wil sleep "X" seconds
> - After sleeping the batchfile will rename a other file that stay in
> the same map of de batchfile.
>
> De name of that file must be: movie_1_YYYYMMDD_HHMMSS.wmv
> YYYYMMDD refert to de date of the moment that de batchfile is running
> HHMMSS refert to de time of the moment that de batchfile is running
>
> (Example: When i run the batch file on 2008-12-16 and on time 16:02:57,
> the name of the file that must be renamed is:
> movie_1_20081206_160257.wmv  and must be renamed in movie.wmv)
>
> De file must be renamed to "movie.wmv".
> After renaming the fill must be uploaded with a FTP script
> And after uploading the file must be deleting in de local folder (NOT!
> on the ftp server).
>
> After deleting, the batch is finish.
>
> So who can make some script? :-)
>
>
>
> Steven

You probably need to think a little harder about your requirements. In your
example you write

==========
(Example: When i run the batch file on 2008-12-16 and on time 16:02:57,
the name of the file that must be renamed is:
movie_1_20081206_160257.wmv  and must be renamed in movie.wmv)
==========

In other words, you expect the batch file to do this:
ren   movie_1_20081206_160257.wmv   movie.mwv

This requirement will cause many failures because it is quite likely that
the "seconds" have ticked over to the next number by the time the batch file
runs. Putting it another way, your file name might be
movie_1_20081206_160257.wmv
but it might well be 16:02:58 at the time the batch file runs. It might even
be much later if the system is very busy, e.g. with a virus scanner pattern
file update or with an Automatic Windows Update.
Author
16 Dec 2008 4:57 PM
stevenjansen
OK, i'm sorry, My English is very bat. But I think what you mean.
Maybe is this possible idea:

A program on my computer will open the batchfile
The batchfile wil sleep "X" seconds
After sleep "X" seconds, the batchfile will rename a file that is on the last time modified.

With other words; A file that is last modified will rename by the batch file in "movie.exe".
Than the file will be uploaded bij a ftp and after that de local file will be deleted. -- stevenjansen ------------------------------------------------------------------------ stevenjansen's Profile: http://forums.techarena.in/members/stevenjansen.htm View this thread: http://forums.techarena.in/server-scripting/1088584.htmhttp://forums.techarena.in
Author
16 Dec 2008 5:43 PM
Pegasus (MVP)
You could use something like this:

@echo off
set Source=d:\Movie Files
set script=c:\script.scr
set site=ftp.jansen.com
set user=steven
set password=SomePassword

for /F "delims=" %%a in ('dir /b /od "%Source%"') do set name=%%a
if exist "%Source%\movie.mwv" del "%Source%\movie.mwv"
ren "%Source%\%name%" movie.mwv

echo> %script% %user%
echo>>%script% %password%
echo>>%script% binary
echo>>%script% put "%name%"
echo>>%script% quit

ftp -s:%Script% %site%
del %script%
del "%Source%\movie.mwv"


Show quoteHide quote
"stevenjansen" <stevenjansen.3kiujb@DoNotSpam.com> wrote in message
news:stevenjansen.3kiujb@DoNotSpam.com...
>
> OK, i'm sorry, My English is very bat. But I think what you mean.
> Maybe is this possible idea:
>
> A program on my computer will open the batchfile
> The batchfile wil sleep "X" seconds
> After sleep "X" seconds, the batchfile will rename a file that is on
> the last time modified.
>
> With other words; A file that is last modified will rename by the batch
> file in "movie.exe".
> Than the file will be uploaded bij a ftp and after that de local file
> will be deleted.
>
>
> --
> stevenjansen
> ------------------------------------------------------------------------
> stevenjansen's Profile:
> http://forums.techarena.in/members/stevenjansen.htm
> View this thread: http://forums.techarena.in/server-scripting/1088584.htm
>
> http://forums.techarena.in
>
Author
17 Dec 2008 10:06 AM
stevenjansen
Ok super, thank you!
I've copy the complete script in Notepad and save the file in de folder "C:\test\script.bat".

I see: "set script=c:\script.scr"
Could you tell what the file "script.scr" is? -- stevenjansen ------------------------------------------------------------------------ stevenjansen's Profile: http://forums.techarena.in/members/stevenjansen.htm View this thread: http://forums.techarena.in/server-scripting/1088584.htmhttp://forums.techarena.in
Author
17 Dec 2008 11:06 AM
Pegasus (MVP)
Show quote Hide quote
"stevenjansen" <stevenjansen.3kk5rc@DoNotSpam.com> wrote in message
news:stevenjansen.3kk5rc@DoNotSpam.com...
>
> Ok super, thank you!
> I've copy the complete script in Notepad and save the file in de folder
> "C:\test\script.bat".
>
> I see: "set script=c:\script.scr"
> Could you tell what the file "script.scr" is?
> --
> stevenjansen
> ------------------------------------------------------------------------
> stevenjansen's Profile:
> http://forums.techarena.in/members/stevenjansen.htm
> View this thread: http://forums.techarena.in/server-scripting/1088584.htm
>
> http://forums.techarena.in

Script.scr is a script file containing a number of commands that are
meaningful for ftp.exe. It gets generated each time you run the batch file.
If you prefer then you can call it stevenjansen.xyz . . .
Author
17 Dec 2008 11:23 AM
stevenjansen
Thank you! It's works perfectly. -- stevenjansen ------------------------------------------------------------------------ stevenjansen's Profile: http://forums.techarena.in/members/stevenjansen.htm View this thread: http://forums.techarena.in/server-scripting/1088584.htmhttp://forums.techarena.in
Author
17 Dec 2008 1:24 PM
Pegasus (MVP)
Thanks for the feedback.

Show quoteHide quote
"stevenjansen" <stevenjansen.3kkbbc@DoNotSpam.com> wrote in message
news:stevenjansen.3kkbbc@DoNotSpam.com...
>
> Thank you! It's works perfectly.
>
>
> --
> stevenjansen