InterviewSolution
Saved Bookmarks
| 1. |
Solve : Messy Autorun + Batch Files? |
|
Answer» Well I have some exprience in programming, but it doesn't help me here...
Autorun.inf Contains : Code: [Select][autorun] ICON=1.ico OPEN=CFG.bat CFG.BAT swaps icons for the device My question is : How do I make the CFG.BAT execute only once - Even if I try to autoplay it ? And if I try to autoplay it, I would just get a new WINDOW SHOWING the device - How to do that ? Darn, I really need to know how have the batch file create a "flag" file on the key drive, and check for it's existence when it starts, and if so, quit. Of course this means it would only execute once during it's lifetime... but to simply get a new window showing the device, either execute "explorer ." in cfg.bat, or as the RUN= line. Also, under what circumstances does it swap icons?Well my intention was to swap the icons when I connect it But I don't get the "flag file" thing Could you tell me more ?Oh I'm sorry- a "flag" file would just be a file you create in the CFG.bat on the key- it doesn't matter whant you call it or what is in it, because the batch file will simply be testing for it's existence when it first starts. If it exists, then it had been executed. The problem is it doesn't really work, since you want it to run the autorun code everytime it in plugged in. In this case it will only work the first TIME. |
|