Link to home
Start Free TrialLog in
Avatar of William Larkin
William LarkinFlag for United States of America

asked on

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.
SOLUTION
Avatar of hypercube
hypercube
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of William Larkin

ASKER

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
William,

Did you try my solution ID: 40885335? It works fine for me.
Thanks Again.. I will give this a try.
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).
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