copying files to workstation(s) public folders

Hi.. I know.. this is probably VERY basic stuff.. not sure why I'm having such a hard time with this.  I have created a folder on our server that is accessible to everyone.  My task is to copy the entire contents of this folder and to put them on the public desktop of workstations. (sound easy right.. but I'm having trouble). The files that I'm trying to copy are customized shortcuts. Thanks for any help! - Bill  (btw.. I'm not familiar with powershell or scripting.. I've been trying to do this using batch files (command line stuff)..  I wouldn't be opposed to powershell, but would need help every step of the way.
William LarkinAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fred MarshallPrincipalCommented:
I'm not really clear on what you want to accomplish:

If the files you would copy are "customized shortcuts" then they must point to something.
Are you expecting those pointers to survive moving to another computer?
If so, what is the approach you have in mind for this?

For example, here is one from my Windows 7 workstation:
Target: "C:\Program Files (x86)\DAEMON Tools Lite\DTLite.exe"
Start In: "C:\Program Files (x86)\DAEMON Tools Lite"
 
Perhaps this isn't the best example because it's an .exe file.  But, actually, I didn't find any in the Public Desktop folder that weren't!
So, I added a shortcut to a text file there:

Target: C:\Users\Fred\Desktop\testfile.txt
Start In: C:\Users\Fred\Desktop
and it just happens that the file is in the Fred\Desktop folder on this computer.

So, using this as an example, one might expect the shortcuts to be something like this:
Target: \\Server\C:\Users\Fred\Desktop\testfile.txt
Start In: \\Server\C:\Users\Fred\Desktop

This makes sense to me for text files *as long as* they are reachable on the server where they are located.  They may not be accessible!  So there's one challenge.

And, obviously, the shortcuts need to be edited to add the server path.
I Googled and found some.  Here is one:
http://www.howtogeek.com/190897/how-can-you-open-and-edit-windows-.lnk-shortcut-files/

It seems that the approaches here could be put into a clever batch file process.

Only after editing should the shortcuts be move into a workstation.
At that, the first step should be ONE workstation and testing for accessibility.
I don't think that most .exe file shortcuts will work but some may.
NVITEnd-user supportCommented:
Here's a .bat solution.

Non-existing folders are logged to a .log file in the %temp% folder.

You need to make a .txt file of the client host names. You can do that using the NET VIEW command. If so, remove the \\ prefixing each name. Mine is called clients2.txt. e.g.
client1
client2

Open in new window

Adjust to your needs: FNClients, Src, FNLog
@echo off
set FNClients=clients2.txt
set Src=\\server\share\files*.*
set FNLog=%temp%\%~n0.log
for /f %%a in (%FNClients%) do (
  if exist "\\%%a\C$\Users\Public\desktop\*." (
    copy "%Src%" "\\%%a\C$\Users\Public\desktop"
  ) else (
    >> "%FNLog%" echo %date% %time% No target "\\%%a\C$\Users\Public\desktop"
  )
)

Open in new window

deroodeSystems AdministratorCommented:
You could configure a Startup script in a group policy, and then add a copy command to your startup script:

xcopy \\sourceserver\share\*.lnk C:\users\public\desktop /D

This is best done in a startup script, which runs in the system context of the computer; Make sure that "everyone" has read access to the source directory, and to the script directory.
You can configure a startup script with the group policy editor on your domain controller, Computer Configuration - Policies - Windows Settings - Scripts - Startup.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SolarWinds® VoIP and Network Quality Manager(VNQM)

WAN and VoIP monitoring tools that can help with troubleshooting via an intuitive web interface. Review quality of service data, including jitter, latency, packet loss, and MOS. Troubleshoot call performance and correlate call issues with WAN performance for Cisco and Avaya calls

William LarkinAuthor Commented:
Thanks for your comments, I am reviewing these.  I am deploying many workstations in a Windows 2008 r2 Domain, and was hoping to automate as much as possible.  In this case, I have to deploy Internet Shortcuts to many desktops and retain the images for the shortcuts.  What I have done so far is (that is working, but could be better): goto the particular website and copy the url, then right click on the desktop and create a new shortcut (pasting the url there) and saving it. Then I search for a picture (internet search) that represents the website and save the image and use an image converter that makes it an ICO file.  Next, I copy this ICO file to a network share and then change the desk shortcuts icon and select the ICO file that is in the network share (available to everyone) and it works! No matter where I deploy this desktop shortcut it looks and works as it should.  Now.. I usually have to deploy this in the Public Folder (which is hidden by default).  Here's what I've done (that doesn't work properly).. I have attempted to create a batch file.. "copy.bat" that looks like this:

net use G: \\ServerName\ShortcutFolder
G:
copy *.* C:\Users\Public\Desktop
net use G: /delete

and I place this file on a network share so I can type in (the run line) \\ServerName\Share\copy  and it doesn't work properly..  I have tried many things.. so I've made two separate batch files that do the job, but I just thought that I could get this to work..  What's happening is that after I execute the copy.bat file it does setup the mapped drive, but that's it.. I have been able to get around this, but then I get access denied messages..

Sorry for the rambling on, but it seems like such a simple thing.. I'm pulling from Way back in my DOS days.. but can't seem to solve this..  I do not know enough about scripting or powershell, but that maybe the way to proceed.  Thanks again for your comments
NVITEnd-user supportCommented:
William,

Did you try my solution ID: 40885335? It works fine for me.
William LarkinAuthor Commented:
Thanks Again.. I will give this a try.
deroodeSystems AdministratorCommented:
If you put the copy command in the same script as the net use commands that won't work; Net use commands should run in the user context, as a network mapping is user-specific. The copy command however requires write rights in the C:\Users\Public folder, which the users does not have.

Therefore you should run the Net Use commands in a login script (which runs in the user context) and the copy command in a System startup script (which runs in the system context).
William LarkinAuthor Commented:
Thanks for ALL help.. I was able to take this information and use parts of all comments to finally get a "workable" solution.. I Really need to learn scripting! - Bill
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Networking

From novice to tech pro — start learning today.