창조 : 제거 USB에 대한 예
# Quick shortcut creation script
# This if the variable that will hold the computer name of your target device
$computer = "The Computer Name"
# This command will create the shortcut object
$WshShell = New-Object -ComObject WScript.Shell
# This is where the shortcut will be created
$Shortcut = $WshShell.CreateShortcut("\\$computer\C$\Users\Public\Desktop\SuperAwesomeness.lnk")
# This is the program the shortcut will open
$Shortcut.TargetPath = "C:\Program Files (x86)\Internet Explorer\iexplore.exe"
# This is the icon location that the shortcut will use
$Shortcut.IconLocation = "C:\AwesomeIcon.ico,0"
# This is any extra parameters that the shortcut may have. For example, opening to a google.com when internet explorer opens
$Shortcut.Arguments = "google.com"
# This command will save all the modifications to the newly created shortcut.
$Shortcut.Save()
대체 : 여기
$AppLocation = "C:\Windows\System32\rundll32.exe"
$WshShell = New-Object -ComObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$Home\Desktop\USB Hardware.lnk")
$Shortcut.TargetPath = $AppLocation
$Shortcut.Arguments ="shell32.dll,Control_RunDLL hotplug.dll"
$Shortcut.IconLocation = "hotplug.dll,0"
$Shortcut.Description ="Device Removal"
$Shortcut.WorkingDirectory ="C:\Windows\System32"
$Shortcut.Save()
는 참조에 대한 링크입니다 : 당신을 위해 Custom Shortcut with PS
감사 대답하지만, 파일이나 웹 페이지에 대한 간단한 바로 가기를 만드는 방법을 이미 알고 있습니다. 내 주요 문제는 네트워크 장치에 대한 경로를 지정하는 것입니다. 제 경우에는 웹캠에 대한 바로 가기가 필요합니다. 카메라가 Windows에서 발견되고 네트워크/기타 장치/카메라 아래에 나열됩니다. UPnP를 사용하여 자신을 UUID로 식별합니다 : Upnp-BasicDevice-1_0-. –
MathiasS