• Can I mark an USB drive as data-only ?

    From R.Wieser@21:1/5 to All on Thu Oct 28 11:31:16 2021
    XPost: alt.windows7.general

    Hello all,

    I've got an USB drive which I sometimes connect to a different (XPsp3) computer. Every time such a computer sees a new USB drive it pops up a
    dialog in which I have to chose what kind of data is on the drive : music, movies, data, etc.

    This has become a bit of a nuissance to me.

    I know I can /tell the OS/ how it should (initially) regard such a new USB drive, but that does not help much when the USB drive is plugged into a new 'puter.

    My question : is there a way to *mark the USB drive itself* as being a data drive (and therefore skipping the above mentioned dialog) ?

    Regards,
    Rudy Wieser

    P.s.
    I did a quick-ish search for the above, but didn't get any leads.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JJ@21:1/5 to R.Wieser on Thu Oct 28 18:37:32 2021
    XPost: alt.windows7.general

    On Thu, 28 Oct 2021 11:31:16 +0200, R.Wieser wrote:
    Hello all,

    I've got an USB drive which I sometimes connect to a different (XPsp3) computer. Every time such a computer sees a new USB drive it pops up a dialog in which I have to chose what kind of data is on the drive : music, movies, data, etc.

    This has become a bit of a nuissance to me.

    I know I can /tell the OS/ how it should (initially) regard such a new USB drive, but that does not help much when the USB drive is plugged into a new 'puter.

    My question : is there a way to *mark the USB drive itself* as being a data drive (and therefore skipping the above mentioned dialog) ?

    Regards,
    Rudy Wieser

    P.s.
    I did a quick-ish search for the above, but didn't get any leads.

    The problem is that the AutoPlay feature will always display a dialog when
    it either can't detect what type of content is in the media, or it detects
    that media has mixed content.

    Perhaps making sure that there's no mixed file types in the root folder of
    the media might help. i.e. move any image/video/audio files into a
    subfolder, and make sure there's at least one non image/video/audio file is
    in the root folder. The AutoPlay may need to be configured to treat data
    media to open Explorer or do nothing at all - instead of prompting the user.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From VanguardLH@21:1/5 to R.Wieser on Thu Oct 28 08:16:33 2021
    XPost: alt.windows7.general

    "R.Wieser" <address@not.available> wrote:

    I've got an USB drive which I sometimes connect to a different (XPsp3) computer. Every time such a computer sees a new USB drive it pops up
    a dialog in which I have to chose what kind of data is on the drive :
    music, movies, data, etc.

    This has become a bit of a nuissance to me.

    I know I can /tell the OS/ how it should (initially) regard such a
    new USB drive, but that does not help much when the USB drive is
    plugged into a new 'puter.

    My question : is there a way to *mark the USB drive itself* as being
    a data drive (and therefore skipping the above mentioned dialog) ?

    Disable autoplay in each computer. The USB drive gets assigned a driver letter, so it will be visible in Windows Explorer to open like any other
    drive. There is no way to get the USB drive to disable autoplay in the computer into which it gets plugged.

    The USB enumeration data (saved in the registry during the hardware
    handshaking when the USB drive gets plugged in) only specifies the type
    of device, not the type of files on the device.

    You can search online for "disable autoplay windows <version>". If you
    hit any articles that refer to Microsoft articles, expect those links to
    fail. Microsoft got busy deleting help and KB articles on XP and 7
    after dropping extended support for them. You need to find articles
    that don't rely on external references, and instead give you the
    registry settings to modify.

    Windows 10 exposes the autoplay settings. Just search in the Start menu
    (click Start, start typing "autoplay"). Windows 8 exposed it, too. In
    Windows 7, you opened Control Panel, Hardware and Sound, and selected
    AutoPlay. In Windows 10, I have autoplay simply open File Explorer for
    the USB drive. Back in Windows 7, as I recall, I disabled autoplay,
    plugged in the USB drive, and manually opened Windows Explorer when I
    wanted to look at files on that drive. Way back in Windows XP, you had
    to edit a policy (but Home users didn't have gpedit.msc), or make
    registry edits. At some point, Microsoft disabled AutoRun in Windows,
    but back in Windows XP you had to do that via registry edit.

    https://auditsquare.com/advisory/windows/how-to-disable-autorun

    While that makes it look like you disable autoplay per drive, it
    probably actually just changed the bit it the bitmask value for a
    registry entry. That is, if you select a DVD drive and disable autoplay
    for it, all device types of optical media had autoplay disabled. Same
    for USB drives: plug in a USB drive, right-click on it in Windows
    Explorer to select Properties, and use the AutoPlay tab to Take No
    Action. You probably have to use the content type drop-down box to pick
    other media types, and select Take No Action for them, too. Since the
    registry entry is bitmasked, each media type had its own bit in the
    value, and this is just a GUI means of changing each bit.

    https://support.microsoft.com/en-us/topic/how-to-disable-the-autorun-functionality-in-windows-8e5ff0da-c526-7624-c064-ff82aecfd145

    Been awhile since I last used Windows XP. Almost looks like Windows XP
    didn't have autoplay, just autorun, and later Microsoft sliced apart
    autorun into simple autorun (when the autorun.inf file is found in the
    root folder of removable media) and autoplay (type of action based on
    content type of injected removable media). That article mentions the
    policy settings in the registry (all policies are registry entries) that
    you change if you don't have gpedit.msc (missing in Home editions). It
    shows the bitmasking of the value (what each bit in the value controls).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Thu Oct 28 19:50:28 2021
    XPost: alt.windows7.general

    Vanguard,

    Disable autoplay in each computer.

    Shucks. :-(

    I thought I was rather clear about both knowing about that particular method and not wanting to depend on it.

    Reason ? Not all those new 'puters I'm connecting the USB drive to are
    mine, and the actual owner/user might like that dialog.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Frank Slootweg@21:1/5 to R.Wieser on Thu Oct 28 18:55:05 2021
    XPost: alt.windows7.general

    R.Wieser <address@not.available> wrote:
    Vanguard,

    Disable autoplay in each computer.

    Shucks. :-(

    I thought I was rather clear about both knowing about that particular method and not wanting to depend on it.

    Reason ? Not all those new 'puters I'm connecting the USB drive to are
    mine, and the actual owner/user might like that dialog.

    I was thinking about putting an 'empty'/do-nothing AutoRun (not
    AutoPlay) file on your USB drive, but a quick search seems to indicate
    that - for security reasons - AutoRun does not work anymore on
    non-CD/DVD media, at least not on Windows 7 and up.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Frank Slootweg@21:1/5 to R.Wieser on Thu Oct 28 19:01:52 2021
    XPost: alt.windows7.general

    Rudy,

    JJ's 'Followup-To: alt.windows7.general' caused you/us to lose the microsoft.public.windowsxp.general group, so I hadn't yet seen your
    below post when I talked about AutoRun. (I've re-instated the XP group.)

    R.Wieser <address@not.available> wrote:
    JJ,

    The problem is that the AutoPlay feature will always display a dialog
    when it either can't detect what type of content is in the media, or
    it detects that media has mixed content.

    I know I can disable that behaviour by changing something in the registry. The thing I currently do not know if perhaps some kind of configuration file on the USB drive would be able to do the same - but just for that drive.

    I've already put a "autorun.inf" file on a few to make their icons different in the file explorer (nice to easily be able to recognise a specific USB drive). I could imagine that it could also have an entry to specify how to handle the drive.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Thu Oct 28 21:44:29 2021
    XPost: alt.windows7.general

    Frank,

    I was thinking about putting an 'empty'/do-nothing AutoRun (not
    AutoPlay) file on your USB drive, but a quick search seems to
    indicate that - for security reasons - AutoRun does not work
    anymore on non-CD/DVD media, at least not on Windows 7 and up.

    I just did a quick search on that, and saw just the "execute a specific program" part being addressed. No mentioning about the "icon", "label" and possibly other (rather) passive entries.

    IOW, autorun.inf could well still work under Win7 - just not the executing
    of a program when the media is inserted.

    And thanks for re-adding the microsoft.public.windowsxp.general newsgroup.

    Regards,
    Rudy Wieser

    P.s.
    Disabeling the "execute a program on media insertion" is one of the first things I've always done after installing the OS on my own 'puters. :-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Fri Oct 29 12:07:01 2021
    XPost: alt.windows7.general

    I've already put a "autorun.inf" file on a few to make their icons
    different in the file explorer (nice to easily be able to recognise a specific USB > drive). I could imagine that it could also have an entry
    to specify how to handle the drive.

    Some more searching, now specifically for the above file, turned up this :

    https://docs.microsoft.com/en-us/windows/win32/shell/autorun-cmds

    The chapter of interrest is "[Content] Keys", in which the types of
    available content can be specified. I'm /assuming/ that the presence of
    that chapter will disable the "content types" dialog (as well as the
    scanning for it).

    Alas, its not recognised under XPsp3 ...

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to R.Wieser on Fri Oct 29 11:51:37 2021
    XPost: alt.windows7.general

    On 10/28/2021 3:44 PM, R.Wieser wrote:
    Frank,

    I was thinking about putting an 'empty'/do-nothing AutoRun (not
    AutoPlay) file on your USB drive, but a quick search seems to
    indicate that - for security reasons - AutoRun does not work
    anymore on non-CD/DVD media, at least not on Windows 7 and up.

    I just did a quick search on that, and saw just the "execute a specific program" part being addressed. No mentioning about the "icon", "label" and possibly other (rather) passive entries.

    IOW, autorun.inf could well still work under Win7 - just not the executing
    of a program when the media is inserted.

    And thanks for re-adding the microsoft.public.windowsxp.general newsgroup.

    Regards,
    Rudy Wieser

    P.s.
    Disabeling the "execute a program on media insertion" is one of the first things I've always done after installing the OS on my own 'puters. :-)

    On the machine side, this behavior is tied into the hardware detection path.

    Insert
    |
    no partitions ---> "Would you like to format this stick?"
    |
    mount partition X ---> "What would you like to do with X: ?"
    |
    mount partition Y ---> "What would you like to do with Y: ?"

    That means, there isn't much of anything you can do from the
    stick side, to modify this behavior. Encrypting the stick won't
    work, because the AutoPlay will attempt to format the stick.
    Or, if the encryption is recognizable, you'll be queried for
    the password.

    Devices where there is no query, are devices that don't carry on
    a recognized service or protocol. You could, for example, create
    a device which is "custom" (there is a USB standards code point for that),
    then use TestDisk or similar, to parse a file system on it. That could
    give you, say, read-access. But not likely to be an entire read/write
    access (I don't know of a software with a full feature set like that,
    because, well, that's what the platform file system driver is for).

    It would be interesting, to test with a USB stick formatted NTFS,
    which has no files on it. Does it have a prompt in that case ?
    If so, then all you need is a storage mechanism which is "not visible" :-) Hidden attribute maybe ?

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Fri Oct 29 18:38:18 2021
    XPost: alt.windows7.general

    Paul,

    That means, there isn't much of anything you can do from the
    stick side, to modify this behavior.

    Whut ? I'm not talking about how Windows mounts its drives. I'm talking about the dialog the AutoPlay service pops up :

    https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/images/cc144212.pix(en-us,vs.85).png )

    https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/images/cc144212.mix(en-us,vs.85).png

    As mentioned in my previous message, you can actually modify that
    behaviour - at least from Vista and up (alas, I've got XPsp3).

    It would be interesting, to test with a USB stick formatted NTFS,
    which has no files on it.

    Why specifically NTFS ?

    But I would expect it *not* to show any dialog, as it can't find any of the filetypes its (read: AutoPlay) looking for.

    -- I just tried it with a brand new FAT32 USb stick and it indeed doesn't
    show any kind of dialogs.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From VanguardLH@21:1/5 to R.Wieser on Fri Oct 29 12:25:07 2021
    XPost: alt.windows7.general

    "R.Wieser" <address@not.available> wrote:

    Vanguard,

    Disable autoplay in each computer.

    Shucks. :-(

    I thought I was rather clear about both knowing about that particular
    method and not wanting to depend on it.

    Reason ? Not all those new 'puters I'm connecting the USB drive to
    are mine, and the actual owner/user might like that dialog.

    Yep, their computer, their choice. You changing their setup might
    irritate them enough for them to be insulted by your changes. Although
    someone else owns the other computer, supposedly they've granted you
    permission to use their computer. So, why not create a new Windows
    account you can setup however you want, like disabling Autoplay in your
    Windows account on their computer?

    If they don't want just anyone creating more accounts on their computer, especially if they don't want to give others more than minimal
    permissions, see if they have the Guest account enabled, log under that,
    and disable Autoplay under the Guest account. The Guest account is a limited/restricted account, so you cannot perform admin-level actions,
    like edit the registry nor install software.

    On Windows XP, Control Panel -> User Accounts, click Guest, turn on.

    For later Windows versions: https://www.howtogeek.com/170269/how-to-let-someone-else-use-your-computer-without-giving-them-access-to-all-your-stuff/

    By default, the Guest account is disabled because it has security vulnerabilities. You need to get someone with admin privileges to login
    to enable the Guest account. Then you can login as Guest.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From VanguardLH@21:1/5 to VanguardLH on Fri Oct 29 12:48:43 2021
    XPost: alt.windows7.general

    VanguardLH <V@nguard.LH> wrote:

    "R.Wieser" <address@not.available> wrote:

    Vanguard,

    Disable autoplay in each computer.

    Shucks. :-(

    I thought I was rather clear about both knowing about that particular
    method and not wanting to depend on it.

    Reason ? Not all those new 'puters I'm connecting the USB drive to
    are mine, and the actual owner/user might like that dialog.

    Yep, their computer, their choice. You changing their setup might
    irritate them enough for them to be insulted by your changes. Although someone else owns the other computer, supposedly they've granted you permission to use their computer. So, why not create a new Windows
    account you can setup however you want, like disabling Autoplay in your Windows account on their computer?

    If they don't want just anyone creating more accounts on their computer, especially if they don't want to give others more than minimal
    permissions, see if they have the Guest account enabled, log under that,
    and disable Autoplay under the Guest account. The Guest account is a limited/restricted account, so you cannot perform admin-level actions,
    like edit the registry nor install software.

    On Windows XP, Control Panel -> User Accounts, click Guest, turn on.

    For later Windows versions: https://www.howtogeek.com/170269/how-to-let-someone-else-use-your-computer-without-giving-them-access-to-all-your-stuff/

    By default, the Guest account is disabled because it has security vulnerabilities. You need to get someone with admin privileges to login
    to enable the Guest account. Then you can login as Guest.

    Hmm, I checked, and the registry edit to disable Autoplay is under:

    key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
    data item name: NoDriveTypeAutoRun
    data item value: bitmasked where each bit represents a device type

    So, Autoplay is a per-account (aka per-user) setting, not a global
    setting across all Windows accounts. The Guest account is in the
    Everyone and Guest Users security groups (permissisions are define per
    security group, and each account is assigned to one, or more, security
    groups). Guest is not a member of the Administrators security group.

    However, as I recall, you cannot use regedit when logged into the Guest account. That means someone with admin priveleges would have to login,
    and edit the registry to disable Autoplay for the Guest account.

    Yet, under HKEY_USERS in the registry, I don't see a SID (S-1-5-*)
    listed for the Guest account. To get a list of Windows accounts and
    their SIDs, I can run in a command shell:

    WMIC useraccount get name,sid

    The Guest account's SID looks like S-1-5-21-*-501

    That isn't listed under HKEY_USERS, so I'm not sure how anyone could
    edit the Autoplay registry entries under an account not shown in the
    registry. That doesn't mean the SID is not defined in the registry. It
    just means regedit.exe doesn't show it. There are lots of registry
    stuff that regedit.exe, a user tool, will not show you even when logged
    in under an Windows account in the Administrators security group.

    Sorry, gotta go, so cannot dig further to see if Autoplay can be
    disabled just for the Guest account.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Fri Oct 29 21:14:24 2021
    XPost: alt.windows7.general

    Vanguard,

    Yep, their computer, their choice.

    Indeed.

    Which is why I'm asking about a method that will work for a particular USB drive.

    If they don't want just anyone creating more accounts on their
    computer especially if they don't want to give others more than
    minimal permissions.

    The idea is that I'm able to skip those dialogs *no matter* which account
    I'm working under. That /might/ be a non-privileged one, but as well the admin account.

    Again, I'm *NOT* looking for /any/ method which needs the target 'puter to
    be configured somehow.

    Hmm, I checked, and the registry edit to disable Autoplay is under:

    key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

    :-) I know. That is what I use on my own 'puters.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)