Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: USB Flash Drive Help  (Read 2911 times)

0 Members and 1 Guest are viewing this topic.

Bug

    Topic Starter


    Newbie

    • Experience: Familiar
    • OS: Windows 7
    USB Flash Drive Help
    « on: September 17, 2013, 04:22:31 PM »
    Hello all, I am new here.
    I got my USB Flash Drive icon to work with this code (saved as autorun.inf in the root directory):

    [autorun]
    label=Lac Phan
    icon=happy.ico

    The icon is called "happy" in the root directory. There is also another icon called "spurs" in the root directory.
    How could I code it so that it alternates between the two icons as the USB flash Drive icon with each plugin/unplug?

    Thank you.

    DaveLembke



      Sage
    • Thanked: 662
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: USB Flash Drive Help
    « Reply #1 on: September 17, 2013, 04:36:39 PM »
    You would need to add a dismount routine that toggles ( overwrites the root from a sub-directory source that has a subdirectory in it of 0 and 1 with each folder contailing the config to write to root. )

    This is probably way more work than it is worth btw as for the drive is usually dismounted by using windows to disconnect the thumb drive and just yanking it out will not make this toggle function and could corrupt the drive. So you will need to write a dismount program that dismounts only this device, but before it dismounts it overwrites the root before the disconnect is established. In such a program you would also need to keep a counter file so it knows to toggle between counter value 0 and 1 and so when the counter is at 1 it set it back to 0 for the next cycle and so it remains on 0, 1, 0, 1, 0, 1 alternation etc in which = 0 is to overwrite the root with that info, and = 1 is to overwrite the root with the other info.

    *Is this a high school programming project? Just sounds like something that would make for interesting project to show off in a classroom where it otherwise is more work than it is worth.

    Bug

      Topic Starter


      Newbie

      • Experience: Familiar
      • OS: Windows 7
      Re: USB Flash Drive Help
      « Reply #2 on: September 17, 2013, 04:51:05 PM »
      Thanks for replying!

      I thought it would be an easy fix where I could understand, but it sounds tough. I guess this wouldn't be able to be do-able (and understandable) in a day, right? And the program is just for my curiosity :)
      Thanks again though.