• DOS search woes!

    Home » Forums » AskWoody support » Windows » Windows – other » DOS search woes!

    Author
    Topic
    #2388844

    Hope all are well; not sure where to put this question.

    In MS-DOS; am searching here as below:

    E:\>dir *presentation*.* /s /p
    Volume in drive E is My Passport
    Volume Serial Number is 103D-D3F2
    File Not Found

    I know for sure that this file exists. Sometimes this works and sometimes it doesn’t!

    Please advise how to address this kind of strange DOS action.

    TIA – BJ

     

    Viewing 6 reply threads
    Author
    Replies
    • #2388846

      Is this really MS-DOS, with an apparently connected USB device? Which version?
      Or do you mean a DOS/Command Prompt in Windows? Which version?
      Your command works fine in Windows 7.

      Does/do the file/s have the Hidden and/or System attribute set? That will hide it/them.
      Try: dir *presentation*.* /s /p /a

      When you navigate directly to the containing folder, does the command then work?

      1 user thanked author for this post.
      • #2388875

        It works for me too on W10 in cmd.exe with USB attached. No extra BIOS action is needed, Im sure about that. Also – the .* is unnescesarry. Try to run:
        dir *presentation* /s /p

        dir

        You can try PowerShell instead, if you think, thr CMD is misbehaving. The command for you is:

        dir *presentation* -s
        Run this command in desired volume (E: for example)

        Example of my search:
        ps

        Dell Latitude 3420, Intel Core i7 @ 2.8 GHz, 16GB RAM, W10 22H2 Enterprise

        HAL3000, AMD Athlon 200GE @ 3,4 GHz, 8GB RAM, Fedora 29

        PRUSA i3 MK3S+

        1 user thanked author for this post.
    • #2388859

      Pretty sure you need some form of BIOS support to get a USB drive working in MS-DOS as said. Perhaps try dir “e:\*presentation*.*” /s /b /p – The  quotes should help; the /b will oddly cause the output to give the location inside folders in W10 etc – drop it for previous or you just get a list of file names.

      I guess another possibility is the activity is causing AV in an overlying Windows OS to suspect “suspicious activity” and scan the files being accessed (which involves them being locked), a process which might also have an effect if CMD is not elevated.

      Finally there is a possible issue with 8.3 file name generation – let’s face it if that background process hasn’t processed your file, accessing the file will probably cause it to happen, and until it does happen, the file could be “invisible” to the MS-DOS  search process (or perhaps appear as the form “presen~1” until then? it could be afterwards if you really use older versions of MS-DOS or the drive content could just not make any sense..), or perhaps this could also be the case if the files were placed on drive E by a “non Windows” OS?

      Would also suggest some diagnostics on the E drive when you are done (you don’t have to drop external drives for them to become unreliable) then chkdsk the volume afterwards. Perhaps use Crystaldiskinfo if you can’t locate the drive diagnostic through western digital. In using the alternative, beware the “pending sector” count. What it really means is the sector seems bad but the drive hasn’t retested it yet.. a full scan with the manufacturer diagnostic will kill (possibly the whole drive!) or pronounce health (possibly after reallocating some sectors; watch for that- it’s a bad sector patching process) so perhaps you really need to carry on with the backup effort for now.

      If back up is what to achieve and you are stuck in DOS, you may want look into using xcopy instead – it has options which suit, being able to deal with the problematic file attributes and perhaps flaky data transfer (/j, /z).

       

    • #2388925

      It seems clear that the DOS rule that all file names must conform to the 8.3 format.

      If I recall correctly, the asterisk in a DOS file name can only be used as a complete 8 or 3 substitute like *.EXE to show all executable files only.  (That STILL cannot be done in Windows!  I have to sort by type to group them together)  I sort of recall the ability to substitute a single position with an ampersand, but don’t quote me on it.  As one who wrote direct video memory mapping (with proper interrupt timing) and direct BIOS access code on a PC-XT, I should know, but that was far too many moons ago to be clear.

      Using Powershell, I was able to do a DIR C: and it worked fine.  I then tried to do a DIR command on the folder: Steves Files (2 words) and it gave an error message.  I tried to do a CD \Steves Files as well as CD Steves Files and got the same error message as well.

      Recalling my early days with Win 98 (I skipped 95) and wanting to do specific ‘tricky’ DOS commands such as showing all files with a wild-card letter in the name, I found out that back then, and true today, I guess, that all files are STILL given 8.3 format names and it is the directory that holds the Windows name, as long as one wants it to be.  So, internally, the name for ‘Steves Files’ in my situation would likely be something like STEV%@33.dir or something screwy like that.  I remember having to experiment with 8 character format names to access a couple of them.

      HOWEVER…not all is lost.  Fortunately, Microsoft implemented a means to not only ‘see’ hidden files (if that’s the problem), but also to change the file attributes of said hidden files making them non-hidden.  Then you can access them in Windows just like all other files.  I’ll leave it to your Windows experience to get you through the methodology.

      • #2388968

        I then tried to do a DIR command on the folder: Steves Files (2 words) and it gave an error message. I tried to do a CD \Steves Files as well as CD Steves Files and got the same error message as well.

        Tip: The older Command Prompt and newer PowerShell still require a pair of double quotes to encapsulate filenames with spaces. (Command Prompt and PowerShell perform auto-completion with a partial filename using the tab key so that is a shortcut.)

    • #2388954

      Hope all are well; not sure where to put this question.

      In MS-DOS; am searching here as below:

      E:\>dir *presentation*.* /s /p
      Volume in drive E is My Passport
      Volume Serial Number is 103D-D3F2
      File Not Found

      I know for sure that this file exists. Sometimes this works and sometimes it doesn’t!

      Please advise how to address this kind of strange DOS action.

      TIA – BJ

       

      where do you know that file exists?

      🍻

      Just because you don't know where you are going doesn't mean any road will get you there.
    • #2389706

      Sorry was offline a bit; amazin replies; thankyou. I am using the PowerShell and other tips as well. Appreciate them.

      Another funny observation; if I remove my external drive, then plug it back in & retry; it works! Sometimes I have to do it 6 or 7 times; then it works.

      Is there something like MOUNT and UNMOUNT kind of thing. As removal can damage the drive permanently.

      BJ

      • #2389779

        When the drive is connected you may see an icon that looks like a flash drive (Windows 10) or the end of a USB cable (Windows 7), you can safely remove the drive (almost*) every time.

        Windows 7 directions for customizing the notification area.

        Windows 10 directions:

        If you do not see any icon when the portable drive is connected, the icon is hidden. Right click on the task bar and open Taskbar Settings, go to the Notification Area section -> click on Select which icons appear on the taskbar. You can turn them all on or the single one you need to enable will have the words Windows Explorer (Safely Remove Hardware and Eject…)

        *If you ever see a message that the drive or file is in use: logging out, rebooting or shutting down your computer while the drive remains connected will release the file or drive.

        I see that checking the file system has been already been recommended, do you need instructions?

    • #2389707

      Hope all are safe and well.

      Is there a “/p” in PowerShell – to pause it?

      Can we pipe to a text file, eg “>”?

      Thankyou.

      BJ

      • #2389718

        powershell does not use / but –

        try it with -p parameter

        Output should be command | Out-File -FilePath .\file.txt.
        Example like this.

        Dell Latitude 3420, Intel Core i7 @ 2.8 GHz, 16GB RAM, W10 22H2 Enterprise

        HAL3000, AMD Athlon 200GE @ 3,4 GHz, 8GB RAM, Fedora 29

        PRUSA i3 MK3S+

    • #2389796

      What happens when you look at the drive with file explorer (windows key, then press e)?

    Viewing 6 reply threads
    Reply To: DOS search woes!

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: