E
E
ezbooz2021-07-07 05:15:10
cmd/bat
ezbooz, 2021-07-07 05:15:10

How to remove an action after it's done?

There is a piece of code: explorer https://google.com
How to make sure that this part is deleted after the first launch? So that at the first opening it opens the specified site, and the subsequent ones no longer. Or create a new .bat with the specified code and delete itself

Answer the question

In order to leave comments, you need to log in

3 answer(s)
W
wisgest, 2021-07-07
@ezbooz

So far it's been like this:

explorer https://google.com& rem rnd_7brydbde
find /v "rnd_7brydbde" <"%~dpnx0" >"%~dpnx0.new"
move /y "%~dpnx0.new" "%~dpnx0" >nul & goto NEXT& rem rnd_7brydbde
:NEXT

V
Vladimir Kuts, 2021-07-07
@fox_12

Create a flag file (well, or vice versa - delete). And at startup, check for its presence. If it is, then we launch it without a website.

M
Maxim Yaroshevich, 2021-07-15
@YMax

After the first launch, I would create a flag file, on subsequent launches, I would check for its presence, and launch / not launch the action.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question