→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
carl_webber
Engaged Sweeper
Hi,

We would like to copy a file from our server's deploymentshare\exes folder to a local PC we would also like to create a shortcut on the desktop.

I have a Domain User setup against the share username and I am able to copy files from other locations on the server.

Is it best to do part in powershell and part in CMD Line?

If someone could supply some syntax commands I would appreciate it.

Thanks
Carl.
1 ACCEPTED SOLUTION
esr
Champion Sweeper
Copy file(s):

Action: Command
Command: cmd.exe /c xcopy.exe /Y {PackageShare}\Installers\PATH_TO\YOUR_FILES\*.* "C:\PATH TO\DESTINATION"



Create shortcut:

NOTE: Calls PowerShell script which is also shown below
Action: Command
Command: powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -Command {PackageShare}\Installers\PATH_TO\YOUR_PS_SCRIPT\MakeLink.ps1


PowerShell script to create desktop shortcut:

# Create EMC Shortcut with modified Target Directory
#$DesktopPath = [Environment]::GetFolderPath("Desktop")
$DesktopPath = 'C:\Users\Public\Desktop'
$WshShell = New-Object -ComObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$DesktopPath\NAME OF YOUR SHORTCUT.lnk")
$Shortcut.TargetPath = "C:\PATH USED FOR TARGET\YOUR APPLICATION.EXE"
$Shortcut.Arguments = 'ANY EXTRA ARGUMENTS THAT SHOULD BE IN THE TARGET LINE'
$Shortcut.Save()

View solution in original post

1 REPLY 1
esr
Champion Sweeper
Copy file(s):

Action: Command
Command: cmd.exe /c xcopy.exe /Y {PackageShare}\Installers\PATH_TO\YOUR_FILES\*.* "C:\PATH TO\DESTINATION"



Create shortcut:

NOTE: Calls PowerShell script which is also shown below
Action: Command
Command: powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -Command {PackageShare}\Installers\PATH_TO\YOUR_PS_SCRIPT\MakeLink.ps1


PowerShell script to create desktop shortcut:

# Create EMC Shortcut with modified Target Directory
#$DesktopPath = [Environment]::GetFolderPath("Desktop")
$DesktopPath = 'C:\Users\Public\Desktop'
$WshShell = New-Object -ComObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$DesktopPath\NAME OF YOUR SHORTCUT.lnk")
$Shortcut.TargetPath = "C:\PATH USED FOR TARGET\YOUR APPLICATION.EXE"
$Shortcut.Arguments = 'ANY EXTRA ARGUMENTS THAT SHOULD BE IN THE TARGET LINE'
$Shortcut.Save()

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now