I have some scripts to do some work for me on Windows 7, and one issue I have is that my most used script lives on a flash drive, clears out the Drivers folder, then opens the Drivers folder for me automatically. Is there any way to have it close the original Windows Explorer window where I clicked the icon? I can't put a shortcut on my desktop because the flash drive letter changes a lot
-
Are you open to the script being a power shell script or must it be a batch script?– Scott ChamberlainMar 17, 2012 at 19:09
-
I don't know about Windows 7, but on XP you can go to Disk Management and assign a drive letter to a flash drive while it is plugged-in and afterwards it will always be assigned that drive letter when you plug it in again (assuming the letter is not in use by something else at the time).– martineauMar 17, 2012 at 19:23
-
@ScottChamberlain I would much rather it be the regular .BAT or .CMD script as it should run on Windows 2000 or higher– Canadian LukeMar 17, 2012 at 19:44
-
@martineau Yes, 7 and Vista can as well; my issue is that this will be in other computers as well, and sometimes I have 3 or 4 other drives plugged in on USB that I scan for as well (I work in a computer shop)– Canadian LukeMar 17, 2012 at 19:44
-
1Luke: OK, then maybe your script could begin by executing this free program which closes all open Explorer windows -- which is overkill but might be acceptable -- only thing is I don't know if it'll work on Win7...– martineauMar 18, 2012 at 19:53
|
Show 7 more comments