Page 1 of 2

copy a file to all users profile desktop

Posted: 28 Feb 2012 13:48
by brightrif
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.

Re: copy a file to all users profile desktop

Posted: 28 Feb 2012 14:43
by Squashman
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.

Re: copy a file to all users profile desktop

Posted: 28 Feb 2012 23:57
by brightrif
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.

Re: copy a file to all users profile desktop

Posted: 29 Feb 2012 02:31
by foxidrive
The files in All Users are available for any profile, new or old.

Re: copy a file to all users profile desktop

Posted: 29 Feb 2012 02:45
by brightrif
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?

Re: copy a file to all users profile desktop

Posted: 29 Feb 2012 02:59
by foxidrive
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.

Re: copy a file to all users profile desktop

Posted: 29 Feb 2012 03:21
by brightrif
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.

Re: copy a file to all users profile desktop

Posted: 29 Feb 2012 03:37
by alan_b
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.

Re: copy a file to all users profile desktop

Posted: 29 Feb 2012 03:39
by foxidrive
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"

Re: copy a file to all users profile desktop

Posted: 29 Feb 2012 03:41
by brightrif
could you explain this briefly

Re: copy a file to all users profile desktop

Posted: 29 Feb 2012 03:45
by foxidrive
Are you using Win7?

Re: copy a file to all users profile desktop

Posted: 29 Feb 2012 03:48
by foxidrive

Code: Select all

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



This should work on all NT flavours of Windows.

Re: copy a file to all users profile desktop

Posted: 29 Feb 2012 03:56
by brightrif
thanks for your replay.

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

Re: copy a file to all users profile desktop

Posted: 29 Feb 2012 04:00
by foxidrive
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.

Re: copy a file to all users profile desktop

Posted: 29 Feb 2012 07:10
by Squashman
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.