G
G
ganbatte2019-03-15 04:37:34
cmd/bat
ganbatte, 2019-03-15 04:37:34

Get vbs result (date). Delete file with that name using cmd. How to do it?

I have this vbs

Yesterday = Date - 1
WSH.Echo Yesterday

Having received this data, I want to delete in cmd.
del (тут результат vbs).txt
I tried to do this, but it doesn't work
del (cscript //nologo C:\Users\Admin\Documents\123\date.vbs).txt

I know that minus the date can be done in cmd, but it’s difficult for me in VBS easily, and I know that in VBS you can delete a file, but it’s difficult there, but it’s easy in cmd. That's why I want to do this...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
res2001, 2019-03-15
@res2001

for /f "delims=" %%a in ('cscript //nologo C:\Users\Admin\Documents\123\date.vbs') do del /f /q %%a.vbs

For details: for /?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question