批处理文件来检测是否已插入笔驱动器

问题描述:

我必须编写一个批处理文件,它执行以下操作: 当插入笔驱动器时,它必须将所有* .mp3文件从pendrive复制到我的C驱动器。我以为我可以通过运行一个批处理文件来运行Windows服务或其他东西,因为我不希望用户知道MP3文件正在被复制。批处理文件来检测是否已插入笔驱动器

非常感谢!

有关如何在背景中启动隐藏批处理文件的信息,请参阅"How can I run a batch file in the background (no windows displayed)?"。要检测笔驱动器,可以检测驱动器号是否存在,请参阅"How do I test if a file is a directory in a Batch script?"How can I detect the drive letter of a booted USB drive from script?