copy a file to all users profile desktop

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
brightrif
Posts: 7
Joined: 28 Feb 2012 13:36

copy a file to all users profile desktop

#1 Post by brightrif » 28 Feb 2012 13:48

i need to 5 files to all user profile.
its very easy for 2,3 users but in my office maximum of the PCs has more than 20 users profile.
IS there any way to do with batch script.

Squashman
Expert
Posts: 3667
Joined: 23 Dec 2011 13:59

Re: copy a file to all users profile desktop

#2 Post by Squashman » 28 Feb 2012 14:43

I think what you meant to say was EVERY user profile. The All Users profile would be just the one profile and that of course would be easy to do. Why not just use the All Users profile instead of copying it to every user profile on the computer. What happens when a new person logs onto the computer. They wouldn't have the file you copied to everyone's profile individually.

brightrif
Posts: 7
Joined: 28 Feb 2012 13:36

Re: copy a file to all users profile desktop

#3 Post by brightrif » 28 Feb 2012 23:57

yes you are right,
but the thing is more than 20 profile created. if you put any files in all users, it wont go to the already created profile.

foxidrive
Expert
Posts: 6033
Joined: 10 Feb 2012 02:20

Re: copy a file to all users profile desktop

#4 Post by foxidrive » 29 Feb 2012 02:31

The files in All Users are available for any profile, new or old.

brightrif
Posts: 7
Joined: 28 Feb 2012 13:36

Re: copy a file to all users profile desktop

#5 Post by brightrif » 29 Feb 2012 02:45

Tell me the solution for this situation…
An old PC already has 20 profiles in the PC. I want to put new file in all profiles desktop.
If I put the file into default profile desktop. Will it come?

foxidrive
Expert
Posts: 6033
Joined: 10 Feb 2012 02:20

Re: copy a file to all users profile desktop

#6 Post by foxidrive » 29 Feb 2012 02:59

If you put it in the All Users desktop then it should appear on every users profile.

Test it yourself on your PC.

Press F5 to refresh your desktop when it is in focus, or reboot.

brightrif
Posts: 7
Joined: 28 Feb 2012 13:36

Re: copy a file to all users profile desktop

#7 Post by brightrif » 29 Feb 2012 03:21

i already tested everything.
windows takes all files the first time profile creation. after create the profile it wont.

thats what i asked the script, it is easy to do with the script.
i am new to batch. could you help anyone.

read the following line

The new profile is in fact created by making a copy of a special profile, named Default User. It is permissible to modify this Default User profile (within certain guidelines) so as to provide a customised working environment for each new user. Modification of the Default User profile should ideally be done from new, prior to any users logging-on to the computer;if a user has already logged on once or more, the Default Profile has no effect whatsoever for that user.

alan_b
Expert
Posts: 357
Joined: 04 Oct 2008 09:49

Re: copy a file to all users profile desktop

#8 Post by alan_b » 29 Feb 2012 03:37

I suggest a total rethink would give an easier solution, and even be essential.

Proposal :-
On each P.C. make available only one instance that is write protected and in a location accessible to all.
This could be a copy of your master file, or even a link via the network so that when you update the central system master file then all users on all P.C.s are instantly up to date.

Benefits :-
1.
No maintenance effort - even when new users and profiles are added.
2.
Write Protection against one user damaging a common resource and affecting others - accidentally or otherwise.

N.B.
The users can make editable copies to their own profiles if they need to.

foxidrive
Expert
Posts: 6033
Joined: 10 Feb 2012 02:20

Re: copy a file to all users profile desktop

#9 Post by foxidrive » 29 Feb 2012 03:39

All Users profile. Try this and check your desktop, if you are using XP. You will need to adjust it for Win7.

Code: Select all

@echo off
echo abc>"c:\Documents and Settings\All Users\Desktop\Testing file.txt"
Last edited by foxidrive on 29 Feb 2012 03:44, edited 1 time in total.

brightrif
Posts: 7
Joined: 28 Feb 2012 13:36

Re: copy a file to all users profile desktop

#10 Post by brightrif » 29 Feb 2012 03:41

could you explain this briefly

foxidrive
Expert
Posts: 6033
Joined: 10 Feb 2012 02:20

Re: copy a file to all users profile desktop

#11 Post by foxidrive » 29 Feb 2012 03:45

Are you using Win7?

foxidrive
Expert
Posts: 6033
Joined: 10 Feb 2012 02:20

Re: copy a file to all users profile desktop

#12 Post by foxidrive » 29 Feb 2012 03:48

Code: Select all

@echo off
echo abc>"%ALLUSERSPROFILE%\Desktop\Testing file.txt"



This should work on all NT flavours of Windows.

brightrif
Posts: 7
Joined: 28 Feb 2012 13:36

Re: copy a file to all users profile desktop

#13 Post by brightrif » 29 Feb 2012 03:56

thanks for your replay.

i am using windows 7. i run this script, Don't work for me

foxidrive
Expert
Posts: 6033
Joined: 10 Feb 2012 02:20

Re: copy a file to all users profile desktop

#14 Post by foxidrive » 29 Feb 2012 04:00

foxidrive wrote:

Code: Select all

@echo off
echo abc>"%ALLUSERSPROFILE%\Desktop\Testing file.txt"



This should work on all NT flavours of Windows.



You have to run it as administrator.

Squashman
Expert
Posts: 3667
Joined: 23 Dec 2011 13:59

Re: copy a file to all users profile desktop

#15 Post by Squashman » 29 Feb 2012 07:10

brightrif wrote:i already tested everything.
windows takes all files the first time profile creation. after create the profile it wont.

thats what i asked the script, it is easy to do with the script.
i am new to batch. could you help anyone.

read the following line

The new profile is in fact created by making a copy of a special profile, named Default User. It is permissible to modify this Default User profile (within certain guidelines) so as to provide a customised working environment for each new user. Modification of the Default User profile should ideally be done from new, prior to any users logging-on to the computer;if a user has already logged on once or more, the Default Profile has no effect whatsoever for that user.

You are confusing the Default User Profile with the All Users Profile. The default is used to create new users but the All users profile is used to populate something for everyone on the computer.

Post Reply