Added script files

This commit is contained in:
László Valkó 2017-11-14 08:34:13 +01:00
parent 103d08f96a
commit f2276280c6
3 changed files with 58 additions and 0 deletions

4
install.cmd Normal file
View file

@ -0,0 +1,4 @@
@echo off
%*
exit /b %errorlevel%

28
pinapp.cmd Normal file
View file

@ -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 ^<exename^>
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%"""

26
unpinapp.cmd Normal file
View file

@ -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 ^<lnkname^>
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"""
)