DCUK6 Posted September 20, 2018 Posted September 20, 2018 Hi, Been asked to create a copy of one file for every student renaming the file to their name. Gotta do this for multiple files and dont like the though of spending hours copying and pasting names and then do it again next year. Has anyone got a CMD script using robocopy or similar? If not, think im gonna need a FOR, Robocopy and an awake mind to work it out. Thanks.
djm968 Posted September 20, 2018 Posted September 20, 2018 Something like this should do it. @echo off for /f "tokens=1,2 delims=," %%j in (project.csv) do ( copy "%%j.jpg" c:\mytestproject\newimages rename "c:\mytestproject\newimages\%%j.jpg" %%k.jpg ) 2
sat_s Posted September 20, 2018 Posted September 20, 2018 Get the students to copy it from the shared area to their home drive and then rename it themselves. 1
djm968 Posted September 20, 2018 Posted September 20, 2018 Get the students to copy it from the shared area to their home drive and then rename it themselves. Good call
DCUK6 Posted September 20, 2018 Author Posted September 20, 2018 Something like this should do it. @echo off for /f "tokens=1,2 delims=," %%j in (project.csv) do ( copy "%%j.jpg" c:\mytestproject\newimages rename "c:\mytestproject\newimages\%%j.jpg" %%k.jpg ) Thanks, SLightly edited for a single file but posting here so i can find again in the future for /f "tokens=1 delims=," %%j in (C:\Users\***\Documents\PIES\studentlist.csv) do ( copy "C:\Users\***\Documents\PIES\PIES MASTER.xlsx" "C:\Users\***\Documents\PIES\PIES %%j.xlsx" ) 1
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