Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows Server » microsoft.public.windows.server.scripting
Thread: Special batchfile

HTVi
TV Discussion Newsgroups

Special batchfile
stevenjansen <stevenjansen.3kiozc[ at ]DoNotSpam.com> 12/16/2008 2:30:43 PM
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.htm http://forums.techarena.in
Re: Special batchfile
"Pegasus \(MVP\)" <I.can[ at ]fly.com.oz> 12/16/2008 3:34:54 PM

"stevenjansen" <stevenjansen.3kiozc[ at ]DoNotSpam.com> wrote in message
news:stevenjansen.3kiozc[ at ]DoNotSpam.com...
[Quoted Text]
>
> 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.


Re: Special batchfile
stevenjansen <stevenjansen.3kiujb[ at ]DoNotSpam.com> 12/16/2008 4:57:34 PM
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
Re: Special batchfile
"Pegasus \(MVP\)" <I.can[ at ]fly.com.oz> 12/16/2008 5:43:20 PM
You could use something like this:

[ at ]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"


"stevenjansen" <stevenjansen.3kiujb[ at ]DoNotSpam.com> wrote in message
news:stevenjansen.3kiujb[ at ]DoNotSpam.com...
[Quoted Text]
>
> 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
>


Re: Special batchfile
stevenjansen <stevenjansen.3kk5rc[ at ]DoNotSpam.com> 12/17/2008 10:06:54 AM
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
Re: Special batchfile
"Pegasus \(MVP\)" <I.can[ at ]fly.com.oz> 12/17/2008 11:06:51 AM

"stevenjansen" <stevenjansen.3kk5rc[ at ]DoNotSpam.com> wrote in message
news:stevenjansen.3kk5rc[ at ]DoNotSpam.com...
[Quoted Text]
>
> 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 . . .


Re: Special batchfile
stevenjansen <stevenjansen.3kkbbc[ at ]DoNotSpam.com> 12/17/2008 11:23:06 AM
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.htm http://forums.techarena.in
Re: Special batchfile
"Pegasus \(MVP\)" <I.can[ at ]fly.com.oz> 12/17/2008 1:24:39 PM
Thanks for the feedback.

"stevenjansen" <stevenjansen.3kkbbc[ at ]DoNotSpam.com> wrote in message
news:stevenjansen.3kkbbc[ at ]DoNotSpam.com...
[Quoted Text]
>
> Thank you! It's works perfectly.
>
>
> --
> stevenjansen


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen