powershell - How to show properly a balloontip? -


i'm writing cleaner known virus key ( "vbs" ,"vbe" ,"wsf", "a3x") registry.

i want add balloontip in powershell script but, there wrong !

i don't know how remove icon taskbar show progress scan ?

this draft. not yet optimized !

@echo off title hackoo virus cleaner delete virus key registry hackoo 2016 color 1a & mode con cols=80 lines=8 set pattern="\.vbs"^ ^ "\.vbe"^ ^ "\.wsf"^ ^ "\.a3x"^ ^ "vbscript.encode"^ ^ "\winlogon\.bat"  set key="hklm\software\microsoft\windows\currentversion\run"^ ^ "hkcu\software\microsoft\windows\currentversion\run"^ ^ "hklm\software\microsoft\windows nt\currentversion\winlogon"^ ^ "hklm\software\microsoft\windows nt\currentversion\image file execution options"  %%p in (%pattern%) (         %%k in (%key%) (                  cls              echo(             echo(             echo         ***************************** scan *****************************             echo             %%k             echo         ****************************************************************             call :ps_sub 'warning' 10 '" please wait... "' "' scan in progress.... %%k'" 'warning'             call :delete_virus_key %%k %%p "%tmplogfile%"         ) ) exit /b ::************************************************************************* :delete_virus_key <key> <pattern> <logfile> setlocal enabledelayedexpansion /f "delims=reg_sz" %%i in (     'reg query "%~1" /s^|findstr /ic:"%~2"'     )    (                  if %errorlevel% neq 1 (                     set keyname="%%~i"                     (                         call:trim !keyname!                         title deleting run key: !keyname!                         echo deleting run key: !keyname!                         echo reg delete "%~1" /v !keyname! /f                         echo(                         echo *****************************                         echo reg delete "%~1" /v "!keyname!" /f                         echo *****************************                         echo(                     )>>"%~3"                     rem call :ps_sub 'warning' 100 '"!keyname!"' "'delete !keyname!'" 'warning'                 ) else (                     set keyname="%%~i"                     call:trim !keyname!                     title deleting run key: !keyname!                     echo deleting run key: !keyname!                     echo reg delete "%~1" /v !keyname! /f                     echo(                     echo *****************************                     echo reg delete "%~1" /v "!keyname!" /f                     echo *****************************                     echo(                 )>>"%~3"             )        ) endlocal exit /b ::************************************************************************* :trim <string> (     echo wscript.echo trim("%~1"^) )>"%tmp%\%~n0.vbs" /f "delims=" %%a in ('cscript /nologo "%tmp%\%~n0.vbs"') (      set "keyname=%%a"  ) exit /b ::************************************************************************** :ps_sub $notifyicon $time $title $text $icon powershell  ^   [reflection.assembly]::loadwithpartialname('system.windows.forms') ^| out-null; ^   [reflection.assembly]::loadwithpartialname('system.drawing') ^| out-null; ^   $notify = new-object system.windows.forms.notifyicon; ^   $notify.icon = [system.drawing.systemicons]::%1; ^   $notify.visible = $true; ^   $notify.showballoontip(%2,%3,%4,%5) %end powershell% exit /b ::************************************************************************* 

so simplify issue, focus on function :

what should add here rid notifyicon taskbar ?

::************************************************************************** :ps_sub $notifyicon $time $title $text $icon powershell  ^   [reflection.assembly]::loadwithpartialname('system.windows.forms') ^| out-null; ^   [reflection.assembly]::loadwithpartialname('system.drawing') ^| out-null; ^   $notify = new-object system.windows.forms.notifyicon; ^   $notify.icon = [system.drawing.systemicons]::%1; ^   $notify.visible = $true; ^   $notify.showballoontip(%2,%3,%4,%5) %end powershell% exit /b ::************************************************************************* 

i solved problem @rojo idea :

::************************************************************************** :ps_sub $notifyicon $time $title $text $icon $timeout powershell  ^   [reflection.assembly]::loadwithpartialname('system.windows.forms') ^| out-null; ^   [reflection.assembly]::loadwithpartialname('system.drawing') ^| out-null; ^   $notify = new-object system.windows.forms.notifyicon; ^   $notify.icon = [system.drawing.systemicons]::%1; ^   $notify.visible = $true; ^   $notify.showballoontip(%2,%3,%4,%5); ^   start-sleep -s %6; ^   $notify.dispose() %end powershell% exit /b ::************************************************************************* 

so, if test whole code in beta version , here link :

hackoo virus cleaner

enter image description here


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -