Log in

View Full Version : DOS help



Pannonian
05-22-2018, 03:47
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.

Husar
05-22-2018, 14:59
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:

Pannonian
05-22-2018, 16:02
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 =

Husar
05-22-2018, 17:59
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.

Pannonian
05-22-2018, 19:21
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?

Husar
05-22-2018, 19:42
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.


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. :shrug:
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).