Results 1 to 6 of 6

Thread: DOS help

  1. #1
    Headless Senior Member Pannonian's Avatar
    Join Date
    Apr 2005
    Posts
    7,978

    Default DOS help

    Is there any way of opening folders in sequence? Ie. I want to start in Computer, then move up to c:\, then move up to c:\batch, and so on. I can open a folder using explorer=<filepath>, but that goes directly to the path, without establishing the path history.

  2. #2
    Iron Fist Senior Member Husar's Avatar
    Join Date
    Jan 2003
    Location
    Germany
    Posts
    15,617

    Default Re: DOS help

    Quote Originally Posted by Pannonian View Post
    Is there any way of opening folders in sequence? Ie. I want to start in Computer, then move up to c:\, then move up to c:\batch, and so on. I can open a folder using explorer=<filepath>, but that goes directly to the path, without establishing the path history.
    There is no "Computer" in DOS as far as I'm aware. So you start in C: and to go to the next directory, you type "cd batch". cd means change directory IIRC.
    The following commands might be useful in that regard, if you don't know any of them yet:

    dir - show the contents of the current directory

    cd <directory name> - as above, switch to given directoy, which has to be a sub-directory of the current directory

    cd.. - go back one directory, e.g. from C:\batch\test back to C:\batch

    cd\ - go back to the drive right away, e.g. from C:\batch\test back to C:\

    <drive letter>: - go to the given drive, e.g. d:
    Last edited by Husar; 05-22-2018 at 15:00.


    "Topic is tired and needs a nap." - Tosa Inu

  3. #3
    Headless Senior Member Pannonian's Avatar
    Join Date
    Apr 2005
    Posts
    7,978

    Default Re: DOS help

    I was unclear as to what I meant. I want to use a batch file to open a batch of windows, then navigate from root (My Computer) to the required directory. This opens an Explorer window.

    explorer =
    This opens an explorer window starting in the required directory.

    explorer = "c:\batch\whatever"
    However, the window starts in said directory, without a navigation history. I'd like to open in My Computer, or c:\ if that's the only way of doing it, then navigate to c:\batch, then to c:\batch\whatever, with the accompanying navigation history. The only way I know of doing it is to manually click through the process. Is there a way of automating it via DOS?

    eg. The below will open five Explorer windows using TryThis.bat.

    explorer =
    explorer =
    explorer =
    explorer =
    explorer =

  4. #4
    Iron Fist Senior Member Husar's Avatar
    Join Date
    Jan 2003
    Location
    Germany
    Posts
    15,617

    Default Re: DOS help

    What Windows are you using? I'm on the latest Win 10 and my explorer opens with the entire path visible when I use your script (with a different path of course).

    You could alternatively try

    start "" "c:\batch\whatever"
    but for me they both open an explorer window with the entire navigation path visible at the top.


    "Topic is tired and needs a nap." - Tosa Inu

  5. #5
    Headless Senior Member Pannonian's Avatar
    Join Date
    Apr 2005
    Posts
    7,978

    Default Re: DOS help

    Quote Originally Posted by Husar View Post
    What Windows are you using? I'm on the latest Win 10 and my explorer opens with the entire path visible when I use your script (with a different path of course).

    You could alternatively try

    but for me they both open an explorer window with the entire navigation path visible at the top.
    I'm using Windows 7. The command you suggest does the same thing as

    explorer = "c:\batch\whatever"
    However, they both open a window with the root as "c:\batch\whatever". What I'd like is a window that has My Computer, or failing that, "c:" as the root, with a navigation history through to ""c:\batch\whatever". I've tried the following, but it doesn't work as cd only changes the focus in command prompt, not navigate through a path tree in a window.

    explorer =
    cd "c:"
    cd "c:\batch"
    cd "c:\batch\whatever"
    I suppose DOS wasn't designed to work with windows, but are there any equivalent commands to cd that does the same thing in Windows Explorer?

  6. #6
    Iron Fist Senior Member Husar's Avatar
    Join Date
    Jan 2003
    Location
    Germany
    Posts
    15,617

    Default Re: DOS help

    Quote Originally Posted by Pannonian View Post
    However, they both open a window with the root as "c:\batch\whatever". What I'd like is a window that has My Computer, or failing that, "c:" as the root, with a navigation history through to ""c:\batch\whatever". I've tried the following, but it doesn't work as cd only changes the focus in command prompt, not navigate through a path tree in a window.
    That's what it does here, at the top it shows "This Computer > Local Drive (D:) > Folder A > Folder B" and I can click on any of them to open them. Could be a difference between the explorer in Windows 7 and 10. I haven't used 7 in a long time but I think I know what you mean. You would basically have to edit the path text to get to a higher folder.

    Quote Originally Posted by Pannonian View Post
    I suppose DOS wasn't designed to work with windows, but are there any equivalent commands to cd that does the same thing in Windows Explorer?
    I for one am not aware of any (which does not necessarily mean that there is no way). Perhaps there are programs where the clicks or navigation steps could be saved as a script or a macro, but that's a big step up from a small batch file.
    Another option could be to get a different explorer and try it with that one (unless you want to distribute the file to thousands of users at work or so).


    "Topic is tired and needs a nap." - Tosa Inu

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO