How to copy files to all Users?
Moderator: DosItHelp
How to copy files to all Users?
Any idea on how to create a batch file that will copy certain files to all Profiles/Users aside from putting the file in c:\users\default\desktops?
Thanks.
Thanks.
Re: How to copy files to all Users?
ssnnjr wrote:Any idea on how to create a batch file that will copy certain files to all Profiles/Users aside from putting the file in c:\users\default\desktops?
Thanks.
Where do you want to copy the files to?
Re: How to copy files to all Users?
foxidrive wrote:ssnnjr wrote:Any idea on how to create a batch file that will copy certain files to all Profiles/Users aside from putting the file in c:\users\default\desktops?
Thanks.
Where do you want to copy the files to?
to all users desktop
Re: How to copy files to all Users?
for /d %a in (c:\users\*) do copy [myfile(s)] %a\Desktop
Substitute [myfile(s)] with your disk:\path\file(s)
Hope this help
M.
Substitute [myfile(s)] with your disk:\path\file(s)
Hope this help
M.
Re: How to copy files to all Users?
Do you mean C:\Users\Public\Desktop?
Re: How to copy files to all Users?
Monoennio wrote:for /d %a in (c:\users\*) do copy [myfile(s)] %a\Desktop
Substitute [myfile(s)] with your disk:\path\file(s)
Hope this help
M.
The OP asked for a batch file. Your code will not work in a batch file.
Re: How to copy files to all Users?
Add a final command to delete the same files from "default\desktop"
Shows us your code if you want advice on it.
I can see "default\desktop" in Windows 8.1 - it is a hidden folder.
Shows us your code if you want advice on it.
Compo wrote:Do you mean C:\Users\Public\Desktop?
I can see "default\desktop" in Windows 8.1 - it is a hidden folder.
Re: How to copy files to all Users?
Squashman wrote:The OP asked for a batch file. Your code will not work in a batch file.
It doesn't handle spaces in usernames either.
Re: How to copy files to all Users?
foxidrive wrote:Compo wrote:Do you mean C:\Users\Public\Desktop?
I can see "default\desktop" in Windows 8.1 - it is a hidden folder.
Are you telling me that copying to a hidden folder is disabled?
Re: How to copy files to all Users?
Compo wrote:foxidrive wrote:Compo wrote:Do you mean C:\Users\Public\Desktop?
I can see "default\desktop" in Windows 8.1 - it is a hidden folder.
Are you telling me that copying to a hidden folder is disabled?
No.
Re: How to copy files to all Users?
Squashman wrote:Monoennio wrote:for /d %a in (c:\users\*) do copy [myfile(s)] %a\Desktop
Substitute [myfile(s)] with your disk:\path\file(s)
Hope this help
M.
The OP asked for a batch file. Your code will not work in a batch file.
True. In a batch file you must use double "%"
for /d %%a in (c:\users\*) do copy [myfile(s)] %%a\Desktop
M.
Re: How to copy files to all Users?
Based on a method I've posted here before:
Code: Select all
@For /F "UseBackQ Tokens=1* Delims==" %%A In (
`WMIc Path Win32_UserProfile Where "Special!='True'" Get LocalPath /Value`
) Do @For %%C In (%%B) Do @Copy [myfile(s)] %%C\Desktop
Re: How to copy files to all Users?
Monoennio wrote:True. In a batch file you must use double "%"
for /d %%a in (c:\users\*) do copy [myfile(s)] %%a\Desktop
M.
It's nice to see you here Monoennio, but please note this too.
foxidrive wrote:It doesn't handle spaces in usernames either.