bonky
Member
- Local time
- 2:06 PM
- Posts
- 24
- OS
- win10
Hi All
I'm trying to create a short cut via CMD
The App
explorer.exe shell:appsFolder\Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe!App
The Command
if exist "C:\Program Files\WindowsApps\Microsoft.MicrosoftStickyNotes*" powershell "$s=(New-Object -COM WScript.Shell).CreateShortcut('%USERPROFILE%\Desktop\Test.lnk');$s.WorkingDirectory='C:\Windows\system32';$s.TargetPath='explorer.exe shell:appsFolder\Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe!App';$s.Save()"
But its failing.... I suspect its not liking the ':' can anyone help in a work around?
The Error
Value does not fall within the expected range.
At line:1 char:128
+ ... s\system32';$s.TargetPath='explorer.exe shell:appsFolder\Microsoft.Mi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException
I'm trying to create a short cut via CMD
The App
explorer.exe shell:appsFolder\Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe!App
The Command
if exist "C:\Program Files\WindowsApps\Microsoft.MicrosoftStickyNotes*" powershell "$s=(New-Object -COM WScript.Shell).CreateShortcut('%USERPROFILE%\Desktop\Test.lnk');$s.WorkingDirectory='C:\Windows\system32';$s.TargetPath='explorer.exe shell:appsFolder\Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe!App';$s.Save()"
But its failing.... I suspect its not liking the ':' can anyone help in a work around?
The Error
Value does not fall within the expected range.
At line:1 char:128
+ ... s\system32';$s.TargetPath='explorer.exe shell:appsFolder\Microsoft.Mi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException
My Computer
System One
-
- OS
- win10
- Computer type
- PC/Desktop





