Solved

I'd like to use pstools to copy a .lnk file from a network share to a local folder on each workstation's desktop.

Posted on 2016-08-23
6
53 Views
Last Modified: 2016-08-23
Having some difficulty with the syntax/understanding what exactly i'm trying to accomplish.

psexec -s \\hostname-pc COPY \\server\share\file.lnk ????C:/?  I'm not sure how to "phrase" the destination.  

Since the initial command of "psexec -s \\hostname-pc . . ." runs the command from THAT hostname-pc right?  So do I have to use a "shared" folder on the workstation to copy this file to?  Or since i'm running the command from that workstation can I use any filepath?  

Synopsis:
I have a .lnk(shortcut) file that runs system restore and creates a manual restore point.  I'd like to push this file to my desktop users local machines so the shortcut could be run at anytime.  Well over 100 workstations to copy this file to so using psexec or something similar would be awesome.
0
Comment
Question by:Daniel Checksum
  • 3
  • 3
6 Comments
 
LVL 23

Accepted Solution

by:
NVIT earned 500 total points
ID: 41767239
To copy to all stations in the domain...
psexec \\* -s -c cmd /c COPY \\server\share\file.lnk c:\

Open in new window


To copy to certain stations in the domain...

- Make a .txt file containing the destination host names, one name per line. E.g. Names.txt
Host1
Host2

Open in new window


psexec @names.txt -s -c cmd /c COPY \\server\share\file.lnk c:\

Open in new window

0
 
LVL 1

Author Comment

by:Daniel Checksum
ID: 41767247
So I would be able to write directly to root C:\?   Or would I have to choose like C:\%userprofile%\Documents ?  

That is where my confusion lies, on the destination end of the copy command.  I appreciate your clear and concise suggestion though.
0
 
LVL 23

Assisted Solution

by:NVIT
NVIT earned 500 total points
ID: 41767249
That complicates things. You'll need each user name to feed into it.

I think you can use the public folder since all/most use the same path.

Or use a gpo/gpp instead of psexec
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 1

Author Comment

by:Daniel Checksum
ID: 41767252
If domain admins have local access to each workstation(which should be already configured) then I should be able to use our domain Administrator account on each workstation right?  My ex-boss also recommended using the Public folders.
0
 
LVL 23

Assisted Solution

by:NVIT
NVIT earned 500 total points
ID: 41767260
As long as its the same on all stations, it should work.
E.g. C:\users\adminname\Documents
1
 
LVL 1

Author Closing Comment

by:Daniel Checksum
ID: 41767263
Thanks for all your help, NVIT.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you use NetMotion Mobility on your PC and plan to upgrade to Windows 10, it may not work unless you take these steps.
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now