Need script for the below.
Files names Day 1.Jpg … Day 60.jpg are available in one directory on the server. Need to copy daily bases from Day 1.jpg to Day 60.jpg to rename file File Tips.jpg in the path \\server path\ File Tips.jpg
Thanks you
Copy and rename file
Moderator: DosItHelp
Re: Copy and rename file
rajgan wrote:Need script for the below.
Files names Day 1.Jpg … Day 60.jpg are available in one directory on the server.
I'm with you up to this part.
Need to copy daily bases from Day 1.jpg to Day 60.jpg to rename file File Tips.jpg in the path \\server path\ File Tips.jpg
I'm not sure what you are asking for in this part.
Re: Copy and rename file
Thanks you for replay.
The file names start from "desktop 01.jpg" to "desktop 60.jpg" are stored in the server1 share folder (\\server1\desktop 01.jpg).
In another server2, "desktop image.jpg" file are stored in share folder (\\server2\desktop image.jpg). This file is used for desktop background image (wallpaper).
An daily bases, the files are start from "desktop 01.jpg" to "desktop 60.jpg" copy from server1 and rename to "desktop image.jpg" and save to \\server2\desktop image.jpg
The task is windows wallpaper image is changed daily on server2.
For example:
Day 1 - desktop 01.jpg
Day 2 - desktop 02.jpg
.
.
Day60 - desktop 60.jpg
Day61 - desktop 01.jpg
The file names start from "desktop 01.jpg" to "desktop 60.jpg" are stored in the server1 share folder (\\server1\desktop 01.jpg).
In another server2, "desktop image.jpg" file are stored in share folder (\\server2\desktop image.jpg). This file is used for desktop background image (wallpaper).
An daily bases, the files are start from "desktop 01.jpg" to "desktop 60.jpg" copy from server1 and rename to "desktop image.jpg" and save to \\server2\desktop image.jpg
The task is windows wallpaper image is changed daily on server2.
For example:
Day 1 - desktop 01.jpg
Day 2 - desktop 02.jpg
.
.
Day60 - desktop 60.jpg
Day61 - desktop 01.jpg
Re: Copy and rename file
rajgan wrote:The task is windows wallpaper image is changed daily on server2.
For example:
Day 1 - desktop 01.jpg
Day 2 - desktop 02.jpg
.
.
Day60 - desktop 60.jpg
Day61 - desktop 01.jpg
I see, that's clearer, thank you.
Are there only 60 files?
Would a random picture from the 60 jpg files be more useful, or do you want to cycle in 60 day sections?
Re: Copy and rename file
Thanks you for replay.
Yes, I have only 60 files.
Yes, I need 60 cycle.
Yes, I have only 60 files.
Yes, I need 60 cycle.
Re: Copy and rename file
This will copy the new picture number every time it is launched, and in a 60 number cycle.
When it reaches 60 it will begin at 01 again.
To test it just keep launching it. It will not copy any picture and only show the command on the screen.
Once you are happy with it then remove the last line with pause in it and also the echo at the very start of the line before the word copy.
When it reaches 60 it will begin at 01 again.
To test it just keep launching it. It will not copy any picture and only show the command on the screen.
Once you are happy with it then remove the last line with pause in it and also the echo at the very start of the line before the word copy.
Code: Select all
@echo off
if not exist "%temp%\picnum.bin" >"%temp%\picnum.bin" echo.100
find "160" < "%temp%\picnum.bin" >nul && >"%temp%\picnum.bin" echo.100
for /f "usebackq delims=" %%a in ("%temp%\picnum.bin") do set /a "num=%%a+1"
set "picnum=%num:~-2%"
echo copy /b "\\server1\desktop %picnum%.jpg" "\\server2\desktop image.jpg"
>>"%temp%\picnum.bin" echo.%num%
pause & goto :EOF