![]() ![]() ![]() Some details about the shortcut can be obtained by right clicking on it and clicking Properties. ![]() On the face of it a simple shortcut is a tiny file that points to another file, such as an executable to launch a program from your desktop. One of those areas is the humble Windows. Some are used when looking for forensic data and determining the history of certain files. In Windows there are other less well known places that can record information you wouldn’t necessarily expect. Web browser history is one area that everyone knows can store computer and personal data. If ($shorcut.Most computer users will know that certain locations on your computer can store information about what you have done. $pwsh_path = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" If the link already exists and you want to programmatically inspect and change one you can do $shell = New-Object -ComObject WScript.Shell Once we are happy with what we've created, we finally call Save() to actually persist that link to the path specified. It won't actually create the link yet, it just initializes the object.įrom there we set TargetPath to the target executable we want to run when the user clicks on it, you can also set other properties like Arguments, WorkingDirectory, IconLocation, and so on. The path we specify is the path where we want to create the link at. $shortcut.TargetPath = "C:\Windows\System32\cmd.exe"įirst off we create a WScript.Shell object, next we create the link object using the CreateShortcut method. $shortcut = $shell.CreateShortcut("C:\temp\shortcut.lnk") You still need to use the Shell object to manage shortcuts but it can be quite simple in PowerShell $shell = New-Object -ComObject WScript.Shell Research Triangle Powershell User Group remote-capable.Philadelphia PowerShell User Group remote-capable.Madison Power Users Group remote-capable. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |