How to delete previous folder with a variable name (Batch script)

Viewed 141

I have issue with Chrome update - after download update chrome dont delete and rename new files. After reload chrome it again want to relaunch for update. I've tried to write .bat for resolve it.

I did some with batch script - delete old chrome.exe and chrome_proxy.exe - reneme new_* to normal name

But I can't understand how to delete previous folder if name will change after new update.

cd /d "C:\Program Files (x86)\Google\Chrome\Application"

echo deleting files
del chrome.exe
del chrome_proxy.exe

echo renaming files
ren new_chrome.exe chrome.exe
ren new_chrome_proxy.exe chrome_proxy.exe

Script will delete previous folder with name that can change after new update.enter image description here

0 Answers
Related