bishop144

New Member
Joined
May 25, 2014
Messages
11
My colleges' computers reset themselves every night, so we are allowed to install programs and change files & settings at will, because the changes revert on shutdown. I'm trying to create a batch file I can run to copy all the files I use & install the programs I use, I haven't gotten to the programs yet, but I've hit a snag, Whenever I try to run the Copy -y command in a batch file I get "Access Denied" and no other details. Can anyone help?
 
Solution
This command:

for /d %%a in (C:\users\7*) do copy J:\*.* %%a\desktop\

will copy all files from the root of a drive J to the desktop folder of any user beginning with the digit 7.
Which files are you trying to copy and where are the locations from which your are trying to read and to which you are trying to write?
 
The files are on my flash drive, and I'm trying to copy them directly to the desktop. All of the computers use user names like 734 or 722, so i've tried using wildcards ? and * but neither work
 
Are you saying that you're trying to specify a user folder name with a wildcard in it, such as C:\users\7??\desktop\*.*
 
Ok, ill give an example one of the files I'm trying to get the command to copy is example.jar. I need example.jar copied from the flash drive (lets just use letter J) J:\ to C:\Users\7??\Desktop. I'm using wildcards as a representation, each different lab of computers has a different username some are 733 some are 718. So you get on the computer in one lab and everyones' username is 733 where in another lab everyones name is 718. I need this command to be able to run on all of the computers.
 
You need a different command structure to use wildcards in folders and directories. I'm up to my neck in things at the moment - I'll get back to you asap.
 
This command:

for /d %%a in (C:\users\7*) do copy J:\*.* %%a\desktop\

will copy all files from the root of a drive J to the desktop folder of any user beginning with the digit 7.
 
Solution