Jump to content

Closing windows explorer


Recommended Posts

OK i have a little problem here.

no its not part of my unattended install, but i figure this is where most of the batch file people will be and have the most knowledge.

I have created an autorun.inf for my usb flash disk. so when ever i double click on it from my computer it will run a small batch file to Synchronize my hard drive files to my flash drive files at home or at uni, depening where i am. then finnaly so i don;t have to right click on the drive I have added

explorer X:
explorer E:

As the last to lines.

However id like to close the "explorer E:" window when im at home.

(e: is what is is called at uni, while i have ity set as x at home)

I have tried

taskkill /f /FI "windowtitle eq ISO*"

But that seems to do nothing

Does anybody know how i can close that window, title ISO as well as My Computer

Thanks

Mentalindustries

Link to comment
Share on other sites


i think u can get computer names

and make some if statements for it.

so when it founds that u're at home it'll open E drive

when u're at your uni it'll open X drive.

i'm sure u sit at different computers at uni so make

if at home open e drive

else open x...

so this way u won't have to deal with closing the window, only opening..

Link to comment
Share on other sites

Thank you XtremeMaC and jdoe

Works great

Echo.
ECHO opening up explorer to USB
IF EXIST E:\autorun.inf (Explorer E:)
IF EXIST E:\autorun.inf (E:\apps\cmdow.exe "My Computer" /CLS)
IF EXIST X:\autorun.inf (Explorer X:)
IF EXIST X:\autorun.inf (X:\apps\cmdow.exe "My Computer" /CLS)

E: at home will never have a autorun.inf as it is a storage drive not cdrom.

If anyone has a even better solution for example build on XtremeMaC

idea of %computername% (note this does NOT work) remebering will be used on a somewhat controlled system eg no reg edits allowed , then feel free as im sure there will be more people wanting to do this as time goes by.

note:. X:\ is what the drive is called (at home) and is not a random variable.

Thanks

Mentalindustires

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...