Today, I suddenly found myself used to throwing all the commonly used files on the desktop. The desktop is terrible for a long time, and because I am not used to archiving, documents are often lost.
So I wrote the followingCode:
VaR FSO = wscript. Createobject ("scripting. FileSystemObject ");
VaR target = "C :\\ Doc \"; // change it to your archive folder.
If (! FSO. folderexists (target ))
{
FSO. createfolder (target );
}
VaR ARGs = wscript. arguments;
For (VAR I = 0; I <args. length; I ++)
{
If (FSO. fileexists (ARGs (I )))
{
FSO. movefile (ARGs (I), target );
}
Else if (FSO. folderexists (ARGs (I )))
{
FSO. movefolder (ARGs (I), target );
}
}
Create a new file named pigeonhole. js and save it to the desktop. Then, use the mouse to ring all the folders and files to be organized, and drag them to the JS file icon, and the files and folders will be automatically transferred to the archive folder.
Haha, isn't it boring.