Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Script to copy a desktop s/cut via login script.

Reply
Thread Tools Display Modes

Script to copy a desktop s/cut via login script.

 
 
Fred Bloggs
Guest
Posts: n/a

 
      01-04-2010
Hi,
I'm trying to get a desktop shortcut pushed out to all users on the network
here, and I've stumbled across this line to add to the login script to do
so.

xcopy \\myDC\NETLOGON\DESKTOP ICONS C:\Documents and Settings\All
Users\Desktop /d /y

my issue is that we have setup the offline sync of mydocs etc and this path
does not exist on every ones pc.

The path it need to go to is going to be C:\users\user.name\desktop

What chane needs to be made to the code to automatically add the shortcut to
anyone's desktop who logs into the pc.

Many thanks



 
Reply With Quote
 
 
 
 
Pegasus [MVP]
Guest
Posts: n/a

 
      01-04-2010


"Fred Bloggs" <> said this in news item
news:...
> Hi,
> I'm trying to get a desktop shortcut pushed out to all users on the
> network here, and I've stumbled across this line to add to the login
> script to do so.
>
> xcopy \\myDC\NETLOGON\DESKTOP ICONS C:\Documents and Settings\All
> Users\Desktop /d /y
>
> my issue is that we have setup the offline sync of mydocs etc and this
> path does not exist on every ones pc.
>
> The path it need to go to is going to be C:\users\user.name\desktop
>
> What chane needs to be made to the code to automatically add the shortcut
> to anyone's desktop who logs into the pc.
>
> Many thanks


You need to replace

C:\Documents and Settings\All Users\Desktop
with
%UserProfile%
or with
%AllUsersProfile%
depending on which folder you prefer. Note also that the command

xcopy \\myDC\NETLOGON\DESKTOP ICONS C:\Documents and Settings\All
Users\Desktop

will fail. It should read

xcopy "\\myDC\NETLOGON\DESKTOP ICONS" "C:\Documents and Settings\All
Users\Desktop"

or perhaps

xcopy "\\myDC\NETLOGON\DESKTOP ICONS" "%AllUsersProfile%\Desktop"


 
Reply With Quote
 
Fred Bloggs
Guest
Posts: n/a

 
      01-04-2010
I meant to say that users have redirected folders

"Fred Bloggs" <> wrote in message
news:...
> Hi,
> I'm trying to get a desktop shortcut pushed out to all users on the
> network here, and I've stumbled across this line to add to the login
> script to do so.
>
> xcopy \\myDC\NETLOGON\DESKTOP ICONS C:\Documents and Settings\All
> Users\Desktop /d /y
>
> my issue is that we have setup the offline sync of mydocs etc and this
> path does not exist on every ones pc.
>
> The path it need to go to is going to be C:\users\user.name\desktop
>
> What chane needs to be made to the code to automatically add the shortcut
> to anyone's desktop who logs into the pc.
>
> Many thanks
>
>
>

 
Reply With Quote
 
Fred Bloggs
Guest
Posts: n/a

 
      01-04-2010
Thanks for the script, but what if there is no all users directory as such,
it's hidden, locked and is redirected to the server where things are sync'ed
to.
Is there anyway aside of using "all users" and to use the folder of who ever
is logging in?

Many thanks

"Pegasus [MVP]" <> wrote in message
news:...
>
>
> "Fred Bloggs" <> said this in news item
> news:...
>> Hi,
>> I'm trying to get a desktop shortcut pushed out to all users on the
>> network here, and I've stumbled across this line to add to the login
>> script to do so.
>>
>> xcopy \\myDC\NETLOGON\DESKTOP ICONS C:\Documents and Settings\All
>> Users\Desktop /d /y
>>
>> my issue is that we have setup the offline sync of mydocs etc and this
>> path does not exist on every ones pc.
>>
>> The path it need to go to is going to be C:\users\user.name\desktop
>>
>> What chane needs to be made to the code to automatically add the shortcut
>> to anyone's desktop who logs into the pc.
>>
>> Many thanks

>
> You need to replace
>
> C:\Documents and Settings\All Users\Desktop
> with
> %UserProfile%
> or with
> %AllUsersProfile%
> depending on which folder you prefer. Note also that the command
>
> xcopy \\myDC\NETLOGON\DESKTOP ICONS C:\Documents and Settings\All
> Users\Desktop
>
> will fail. It should read
>
> xcopy "\\myDC\NETLOGON\DESKTOP ICONS" "C:\Documents and Settings\All
> Users\Desktop"
>
> or perhaps
>
> xcopy "\\myDC\NETLOGON\DESKTOP ICONS" "%AllUsersProfile%\Desktop"
>
>

 
Reply With Quote
 
Pegasus [MVP]
Guest
Posts: n/a

 
      01-04-2010
Yes, use %UserProfile% as mentioned.

"Fred Bloggs" <> said this in news item
news:...
> Thanks for the script, but what if there is no all users directory as
> such, it's hidden, locked and is redirected to the server where things are
> sync'ed to.
> Is there anyway aside of using "all users" and to use the folder of who
> ever is logging in?
>
> Many thanks
>
> "Pegasus [MVP]" <> wrote in message
> news:...
>>
>>
>> "Fred Bloggs" <> said this in news item
>> news:...
>>> Hi,
>>> I'm trying to get a desktop shortcut pushed out to all users on the
>>> network here, and I've stumbled across this line to add to the login
>>> script to do so.
>>>
>>> xcopy \\myDC\NETLOGON\DESKTOP ICONS C:\Documents and Settings\All
>>> Users\Desktop /d /y
>>>
>>> my issue is that we have setup the offline sync of mydocs etc and this
>>> path does not exist on every ones pc.
>>>
>>> The path it need to go to is going to be C:\users\user.name\desktop
>>>
>>> What chane needs to be made to the code to automatically add the
>>> shortcut to anyone's desktop who logs into the pc.
>>>
>>> Many thanks

>>
>> You need to replace
>>
>> C:\Documents and Settings\All Users\Desktop
>> with
>> %UserProfile%
>> or with
>> %AllUsersProfile%
>> depending on which folder you prefer. Note also that the command
>>
>> xcopy \\myDC\NETLOGON\DESKTOP ICONS C:\Documents and Settings\All
>> Users\Desktop
>>
>> will fail. It should read
>>
>> xcopy "\\myDC\NETLOGON\DESKTOP ICONS" "C:\Documents and Settings\All
>> Users\Desktop"
>>
>> or perhaps
>>
>> xcopy "\\myDC\NETLOGON\DESKTOP ICONS" "%AllUsersProfile%\Desktop"
>>
>>

 
Reply With Quote
 
Fred Bloggs
Guest
Posts: n/a

 
      01-04-2010

Hi Pegasus, thats working now, many thanks.

one question though, is there a switch to use in the command to
automatically overwrite the file being copied?
I'm intending to include the line in my login script, but don't want the
users to see a dos prompt each day saying "do you want to overwrite" etc.

Many thanks.

"Fred Bloggs" <> wrote in message
news:#...
> I meant to say that users have redirected folders
>
> "Fred Bloggs" <> wrote in message
> news:...
>> Hi,
>> I'm trying to get a desktop shortcut pushed out to all users on the
>> network here, and I've stumbled across this line to add to the login
>> script to do so.
>>
>> xcopy \\myDC\NETLOGON\DESKTOP ICONS C:\Documents and Settings\All
>> Users\Desktop /d /y
>>
>> my issue is that we have setup the offline sync of mydocs etc and this
>> path does not exist on every ones pc.
>>
>> The path it need to go to is going to be C:\users\user.name\desktop
>>
>> What chane needs to be made to the code to automatically add the shortcut
>> to anyone's desktop who logs into the pc.
>>
>> Many thanks
>>
>>
>>

 
Reply With Quote
 
Pegasus [MVP]
Guest
Posts: n/a

 
      01-04-2010
There are numerous switches in xcopy, including one to suppress the
overwrite prompt. Type xcopy /? at the Command Prompt to see them all.

"Fred Bloggs" <> said this in news item
news:...
> Hi Pegasus, thats working now, many thanks.
>
> one question though, is there a switch to use in the command to
> automatically overwrite the file being copied?
> I'm intending to include the line in my login script, but don't want the
> users to see a dos prompt each day saying "do you want to overwrite" etc.
>
> Many thanks.
>
> "Fred Bloggs" <> wrote in message
> news:#...
>> I meant to say that users have redirected folders
>>
>> "Fred Bloggs" <> wrote in message
>> news:...
>>> Hi,
>>> I'm trying to get a desktop shortcut pushed out to all users on the
>>> network here, and I've stumbled across this line to add to the login
>>> script to do so.
>>>
>>> xcopy \\myDC\NETLOGON\DESKTOP ICONS C:\Documents and Settings\All
>>> Users\Desktop /d /y
>>>
>>> my issue is that we have setup the offline sync of mydocs etc and this
>>> path does not exist on every ones pc.
>>>
>>> The path it need to go to is going to be C:\users\user.name\desktop
>>>
>>> What chane needs to be made to the code to automatically add the
>>> shortcut to anyone's desktop who logs into the pc.
>>>
>>> Many thanks
>>>
>>>
>>>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disappearing Restore Points. Help? Julian Windows Vista Performance 7 02-29-2008 10:31 AM
Shadow Copy is not working Sorter13 Windows Vista File Management 3 12-31-2007 03:07 PM
Seeking information on Shadow Copy vs. Backup & Restore. I'm conf DRUAngell Windows Vista Performance 7 03-26-2007 11:05 PM
Cannot copy favorites to desktop... why? Jeroen van Beek Windows Vista Performance 4 03-14-2007 12:14 AM
Re: Programatically Copy Files From Desktop to PocketPC Chris De Herrera ActiveSync 0 12-31-2004 01:57 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59