Question : Create Desktop Shortcut on Remote PC?

I will be copying a folder from my PC to multiple remote PC on my network via a Python script.  This folder contains an application and a shortcut to the application.  Is it possible to copy that shortcut to the remote user's desktop once the folder itself is on their C: drive?

I realize this may be difficult as we are in a networking environment and the desktop folder resides under:
c:\documents and settings\firstname.lastname\desktop

Is it possible to grab that remote user name from my own PC and use it in the code as a variable?

Answer : Create Desktop Shortcut on Remote PC?

I figured out a way utilizing WMI...
1:
2:
3:
4:
5:
6:
7:
8:
import shutil, wmi
for comp in ('COMPUTER1','COMPUTER2','etc'):
  c = wmi.WMI(comp)
  for i in c.Win32_ComputerSystem():
    str_uname = i.UserName
    str_source = (r'\\%s\c$\FOLDER\Shortcut.lnk' %(comp))
    str_dest =  (r'\\%s\c$\Documents and Settings\%s\Desktop' %(comp,str_uname))
    shutil.copy(str_source, str_dest)
Open in New Window Select All
Random Solutions  
 
programming4us programming4us