Created
August 30, 2009 04:16
-
-
Save to/177852 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function remove(path){ | |
var shell = new ActiveXObject('Shell.Application'); | |
var fileSystem = WScript.createObject('Scripting.FileSystemObject'); | |
if(fileSystem.fileExists(path)){ | |
var target = fileSystem.getFile(path); | |
var folder = shell.nameSpace(target.parentFolder.path); | |
shell.nameSpace(10).moveHere(folder.items().item(target.name)); | |
while(fileSystem.fileExists(path)) | |
wait(100); | |
} else if(fileSystem.folderExists(path)) { | |
var target = fileSystem.getFolder(path); | |
var folder = shell.nameSpace(target.path); | |
shell.nameSpace(10).moveHere(folder); | |
while(fileSystem.folderExists(path)) | |
wait(100); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment