Start "" del /q c:\program files\glarysoft\malware hunter\mhtray.exe
does NOT delete that entry.
I suspect it is because of the space between 'program' and 'files'.
If that is true - what is the work around ?
how to stop a space from aborting a batch process
Moderator: DosItHelp
-
- Posts: 34
- Joined: 17 Feb 2017 02:28
Re: how to stop a space from aborting a batch process
Use Quotes with filename/directory:
Saso
Code: Select all
Start "" del /q "c:\program files\glarysoft\malware hunter\mhtray.exe"
-
- Posts: 34
- Joined: 17 Feb 2017 02:28
Re: how to stop a space from aborting a batch process
For reasons too embarrassing to admit, I can not test THAT line of code, but I do believe (I remember) that that is the solution.
Re: how to stop a space from aborting a batch process
Based upon your provided example, I do not see any need for the start command in this case:The del command is internal, so effectively you're opening a new cmd.exe window with the /K option, which would then require closing afterwards, (see the command help, start /?, for more information).
It may also be worth mentioning that in order to delete something from that particular location, you'll probably need to run the command elevated, or as a user with the required privileges.
Code: Select all
Del /F /A "%ProgramFiles%\glarysoft\malware hunter\mhtray.exe"
It may also be worth mentioning that in order to delete something from that particular location, you'll probably need to run the command elevated, or as a user with the required privileges.
-
- Posts: 34
- Joined: 17 Feb 2017 02:28
Re: how to stop a space from aborting a batch process
I realised that I only need to do that once - do not need to do it in a macro. The problem of the space was solved well by the double apostrophes. I withdraw the question.