1
The bat file has been converted to executable.
The command del "%~f0"
does not work! You will need to finish running the executable first taskkill /f "nome_do_executável.exe"
and only then eliminate it?
Question:
- How to find the file in windows and delete it?
Thanks @Sachadee for %~dpnx0
!
start "nome_da_aplicação" cmd.exe /k "mode 90,5 & del /s /q %~dpnx0 >nul 2>&1 & exit"
tested
del "%~dpnx0"
at the end of the script ?– SachaDee
@Sachadee yes, thank you!
– b8engl
Where can I find information about dpnx'?
– b8engl
with
for /?
(last screen)– SachaDee
@Sachadee, thank you!
– b8engl
@Sachadee, The remote control
del /s /q "%~dpnx0"
seems not to be working on the executable... But if you usestart cmd /k "del /s /q %~dpnx0"
works, only a new window opens! How to close this window in one command? Ex:start cmd /k "del %~dpnx0 & exit /b"
?– b8engl
run taskkill can cause Windows Defender to delete its executable file
– Sveen
@Sveen Como... like this?
taskkill /F /FI "WindowTitle eq Administrator: nome_do_programa" /T >nul 2>&1 & del /s /q "%~dpnx0" & exit /b
?– b8engl
If you use
start cmd /k "del %~dpnx0"
it will work (but then a command line is open), only if you finish the command line with taskkill! It seems a bit hammered... There is no possibility to do everything together within the""
?– b8engl
Windows Defender checks whether the program runs a command as taskkill and classifies with malware.
– Sveen
Try it this way @b8engl :
start cmd /k "del %~dpnx0 && exit"
– SachaDee
@ Sachadee Well played!
– b8engl