fil_b Posted October 30, 2009 Posted October 30, 2009 hi there we are playing with batch file where we copy a file to a location and then rename it @echo off rem to remove screen output updates ... less clutter if exist "Z:\Profiles\Teaching\desktop.jpg" del "Z:\Profiles\Teaching\desktop.jpg" /S/Q xcopy "Z:\Profiles\Backgrounds\SELECT - RANDOM.jpg" "Z:\Profiles\Teaching\" /E/I REN Z:\Profiles\Teaching\*.jpg desktop.jpg we can set a file manually, is it possible to make it a random selection for the JPG plz Tar feebs
kmount Posted October 30, 2009 Posted October 30, 2009 I'd name the files by number and then use a random number generator + .jpg Something like Random number batch file - Programming - Forums - www.atomicmpc.com.au I suppose you could in theory read the directory contents into an array and do it that way but this would work fine, how often are you doing it?
fil_b Posted October 30, 2009 Author Posted October 30, 2009 I'd name the files by number and then use a random number generator + .jpg Something like Random number batch file - Programming - Forums - www.atomicmpc.com.au I suppose you could in theory read the directory contents into an array and do it that way but this would work fine, how often are you doing it? we were going to do a schedule to run nightly so every day is different.
Stuart_C Posted October 30, 2009 Posted October 30, 2009 Could you numerically name the files and then just incrament the number e.g. Monday = 1 Tuesdy = 2 and so on?
fil_b Posted October 30, 2009 Author Posted October 30, 2009 Could you numerically name the files and then just incrament the number e.g. Monday = 1 Tuesdy = 2 and so on? if we had 20 or more tho it would break it up numbers for the files is good but how do i do the random select a file for the code??
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now