hi,
I will use this code with powershell:
Remove-Item -Path “C:\ProgramData\Microsoft\Windows Defender\Scans\History\Service*” -Verbose
my problem is, it needs an answer as Keystroke: “J”
I found some things:
#Wscript objekt
$wshell = New-Object -com “Wscript.Shell”
Defender
Remove-Item -Path “C:\ProgramData\Microsoft\Windows Defender\Scans\History\Service*” -Verbose
wait
Start-Sleep 5
send J for yes
$wshell.sendkeys(“J”)
It seems not to run corrct can someone help me? thanks a lot
Olaf
May 26, 2023, 1:06pm
2
Jumbano21,
Welcome back to the forum. Long time no see.
Did you try the parameter -Force
?
The Remove-Item cmdlet deletes one or more items. Because it's supported by many providers, it can delete many different types of items, including files, folders, registry keys, variables, aliases, and functions.
Olaf
May 26, 2023, 1:49pm
4
jumbano:
you mean:
Yes.
And please … when you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
Thanks in advance
How to format code in PowerShell.org 1 <---- Click
(sometimes the button hides behind the settings gear symbol )