From f2276280c6616fc2feaae504650db979567e791f Mon Sep 17 00:00:00 2001 From: Valko Laszlo Date: Tue, 14 Nov 2017 08:34:13 +0100 Subject: [PATCH] Added script files --- install.cmd | 4 ++++ pinapp.cmd | 28 ++++++++++++++++++++++++++++ unpinapp.cmd | 26 ++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 install.cmd create mode 100644 pinapp.cmd create mode 100644 unpinapp.cmd diff --git a/install.cmd b/install.cmd new file mode 100644 index 0000000..f08a59c --- /dev/null +++ b/install.cmd @@ -0,0 +1,4 @@ +@echo off + +%* +exit /b %errorlevel% diff --git a/pinapp.cmd b/pinapp.cmd new file mode 100644 index 0000000..3693796 --- /dev/null +++ b/pinapp.cmd @@ -0,0 +1,28 @@ +@echo off + +if not exist "%systemdrive%\Install\system\getvariables.cmd" ( + echo Missing %systemdrive%\Install\system\getvariables.cmd + exit /b 1 +) +call "%systemdrive%\Install\system\getvariables.cmd" +if [%pinappmod%] == [] ( + echo PINAPPMOD not set! + exit /b 1 +) + +if not exist %pinappmod% ( + echo Missing %pinappmod% + exit /b 1 +) +set _exename=%1 + +if [%_exename%] == [] ( + echo Usage: %0 ^ + exit /b 1 +) +if not exist %_exename% ( + echo Missing executable %_exename% + exit /b 1 +) +echo Pinning application to task bar +powershell -Command "& import-module %pinappmod%; Set-PinnedApplication -Action PinToTaskbar -FilePath ""%_exename%""" diff --git a/unpinapp.cmd b/unpinapp.cmd new file mode 100644 index 0000000..88c726c --- /dev/null +++ b/unpinapp.cmd @@ -0,0 +1,26 @@ +@echo off + +if not exist "%systemdrive%\Install\system\getvariables.cmd" ( + echo Missing %systemdrive%\Install\system\getvariables.cmd + exit /b 1 +) +call "%systemdrive%\Install\system\getvariables.cmd" +if [%pinappmod%] == [] ( + echo PINAPPMOD not set! + exit /b 1 +) + +if not exist %pinappmod% ( + echo Missing %pinappmod% + exit /b 1 +) +set _lnkname=%1 + +if [%_lnkname%] == [] ( + echo Usage: %0 ^ + exit /b 1 +) +for /r "%appdir%\Microsoft\Internet Explorer\Quick Launch\User Pinned\Taskbar" %%j in ("%_lnkname%*.lnk") do ( + echo Removing %%j + powershell -Command "& import-module %pinappmod%; Set-PinnedApplication -Action UnPinFromTaskbar -FilePath ""%%j""" +)