My demo constellation:
- The script directory MyDir contains the script file RemDir.ahk and the interpreter AutoHotkey.exe.
- RemDir.ahk should remove the complete script directory after ExitApp.
- But it deletes only the files contained in MyDir, not the directory itself.
Why is this so? How to do it?
Code: Select all
#Persistent
F9::
Cmd = %ComSpec% /c ping localhost -n 1 > nul & rd /s /q "%A_ScriptDir%"
Run, %Cmd%, , Hide
ExitApp
Return