If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Rate Thread | Display Modes |
#1
|
|||
|
|||
Make multiple cmd windows default to same location?
I often must open multiple (often more than 20) command windows until I get
a successful one, and while ALT+F4 closes the unsuccessful ones one by one, the focus constantly changes so it's not easy to close them all but the last one. It would be so much easier if the command windows were just stacked exactly on top of each other so that the X box stays in the same spot and doesn't jump around all over the screen. The cmd windows that are opened seem to be 'staggered' in some sort of algorithm which puts 1 windows at top left, and then 9 more, staggered to the right and lower, and then back to the 1 window at top left, and so on. All I want is all the windows to default to the same location so that I can keep the mouse in one spot and just left click to close them one by one (I can't close them all because I need just the last one but I can move that last one to a safe location on the screen). In summary, I want to easily close a score of command windows, leaving just the last one alive (where it would be easy if they'd just stay in one place!). Is that possible in Windows to get command windows to open in one spot? (I don't start them manually, I start them by clicking on an openvpn file.) |
Ads |
#2
|
|||
|
|||
Make multiple cmd windows default to same location?
Hazuki Nakamura said:
Is that possible in Windows to get command windows to open in one spot? (I don't start them manually, I start them by clicking on an openvpn file.) Here is what they look like using the default Windows algorithm: http://i.cubeupload.com/wLGhOR.jpg |
#3
|
|||
|
|||
Make multiple cmd windows default to same location?
On Sat, 24 Dec 2016 17:05:49 +0000 (UTC), Hazuki Nakamura
wrote: I often must open multiple (often more than 20) command windows until I get a successful one, Can we start right there? What's that all about? I can think of a lot of scenarios that benefit from having multiple command prompts available, but none include the phrase "until I get a successful one". and while ALT+F4 closes the unsuccessful ones one by one, the focus constantly changes so it's not easy to close them all but the last one. snip |
#4
|
|||
|
|||
Make multiple cmd windows default to same location?
On Sat, 24 Dec 2016 17:07:19 +0000 (UTC), Hazuki Nakamura
wrote: Hazuki Nakamura said: Is that possible in Windows to get command windows to open in one spot? (I don't start them manually, I start them by clicking on an openvpn file.) Here is what they look like using the default Windows algorithm: http://i.cubeupload.com/wLGhOR.jpg Find the / create a shortcut that launches the cmd window, and rt-click the link and choose properties, then the layout tab, unselect Let system position window, and choose the location that you want. You can also make choose its size as well. But why on earth are you launching series of window until one works? Perhaps if you explain what you are trying to do, we may be able to solve your problem more directly. For example, you can also set the properties of the shortcut to close the window automatically after the command it was launched to run has finished. -- ================================================== ====== Please always reply to ng as the email in this post's header does not exist. Or use a contact address at: http://www.macfh.co.uk/JavaJive/JavaJive.html http://www.macfh.co.uk/Macfarlane/Macfarlane.html |
#5
|
|||
|
|||
Make multiple cmd windows default to same location?
Hazuki Nakamura wrote:
Hazuki Nakamura said: Is that possible in Windows to get command windows to open in one spot? (I don't start them manually, I start them by clicking on an openvpn file.) Here is what they look like using the default Windows algorithm: http://i.cubeupload.com/wLGhOR.jpg There are some suggestions here. Apparently a .vbs can launch windows with some degree of control. http://stackoverflow.com/questions/1...-of-the-window Taskkill could kill *all* of your cmd.exe windows easily, with just one command invocation. The part I'm having trouble with, is excluding the window you want to keep. I tried to find a *simple* recipe to put the PID into the Command Prompt title bar, but so far all I've found is a "blizzard of scripts" and nothing that seems to do exactly that. While you can set the title of a cmd.exe window at launch, at that point in time you don't know the PID. The "nircmd" program can probably assign a PID, so maybe you can cobble together something that will label the Command Prompt window that you want to keep. Paul |
#6
|
|||
|
|||
Make multiple cmd windows default to same location?
Java Jive said:
Find the / create a shortcut that launches the cmd window, and rt-click the link and choose properties, then the layout tab, unselect Let system position window, and choose the location that you want. You can also make choose its size as well. But why on earth are you launching series of window until one works? Perhaps if you explain what you are trying to do, we may be able to solve your problem more directly. For example, you can also set the properties of the shortcut to close the window automatically after the command it was launched to run has finished. I have an extremely simple vpn setup which requires only two things: 1. The opensource openvpn desktop client https://openvpn.net/index.php/open-s...downloads.html 2. Any openvpn configuration file http://i.cubeupload.com/Qi3BHb.jpg In practice, since any one vpn configuration file could be bad (by design), I download scores upon scores of openvpn configuration files at a time and then I doubleclick on them to open up a vpn session. I get those openvpn files from vpngate.net and I use the standard opensource openvpn client. In practice, the openvpn files go stale (on purpose, due to the design of vpngate.net to foil censorship) so I just choose the next, and the next and the next openvpn configuration file, until, after about 10 windows (or so), the connection is good. It's not pretty. But it works. And by design, it has a huge advantage over all other free vpn solutions (astoundingly huge advantages). That's fine except there is only one tactical problem I wish to solve which is to clean up my desktop by deleting the 10 (or so) windows that failed. Currently I do that manually, but if all the cmd windows simply opened up in the same spot, that task would be tremendously easier. So all I ask is that ovpn files open up in a command window whose location is static. Is that too much to ask of windows? Here is a sample openvpn file from vpngate.net today: http://www.vpngate.net/common/openvp..._tcp_1976.ovpn |
#7
|
|||
|
|||
Make multiple cmd windows default to same location?
Char Jackson said:
Can we start right there? What's that all about? I can think of a lot of scenarios that benefit from having multiple command prompts available, but none include the phrase "until I get a successful one". Try this which has *huge* advantages over traditional free VPN solutions! 0. Install the official Windows openvpn desktop client https://openvpn.net/index.php/open-s...downloads.html 1. Download a handful of openvpn configuration files. http://vpngate.net (a) First click on any line called "Open VPN Config file". (b) Then select any of the four files that show up (c) For example: OpenVPN Configuration File: vpn671627368.opengw.net (UDP 1532) http://www.vpngate.net/common/openvp..._udp_1532.ovpn 2. Once downloaded, simply doubleclick on those ovpn files until one works. That's it. You're now on VPN. When you want to close the VPN, you just close the command window. It's that easy. 3. The problem is that not ever ovpn file works (by design). In practice, if the files are brand new, most work, but they go stale very quickly (by design, to foil censors). In fact, they go stale within hours (by design). Yet some work for months. Some go off and then on and then off and then on, so saving the old ones saves having to download them again (but saving old ones increases the chance that most will be stale). The solution to stale files is one or the other of the following: a. Figure out how to get wget to download the latest files b. Figure out how to shut command windows if you use older files I tried heroically to get wget to download the files but you will find it NOT EASY to figure out the syntax for wget. For example, here are three files that can be downloaded today manually: http://www.vpngate.net/en/do_openvpn...&hi d=3510189 http://www.vpngate.net/en/do_openvpn...&hi d=4828153 http://www.vpngate.net/en/do_openvpn...&h id=6262531 But how do you figure out a wget algorithm to download them automatically? |
#8
|
|||
|
|||
Make multiple cmd windows default to same location?
Hazuki Nakamura said:
I tried heroically to get wget to download the files but you will find it NOT EASY to figure out the syntax for wget. For example, here are three files that can be downloaded today manually: http://www.vpngate.net/en/do_openvpn...&hi d=3510189 http://www.vpngate.net/en/do_openvpn...&hi d=4828153 http://www.vpngate.net/en/do_openvpn...&h id=6262531 But how do you figure out a wget algorithm to download them automatically? There are two solutions but I can't get either to work yet on Windows. 1. Easily close all command windows but the one I want 2. Use wget to get the latest ovpn files for today I don't know wget well but here is the closest I can get to getting it to work on the vpngate.net ovpn files: c:\bin\gnu\wget\wget --wait=3 --random-wait -r -I /en,/common -A do_openvpn.aspx,openvpn_download.aspx\* -nc -nd http://www.vpngate.net/en/ -e robots=off Do you know how to fix that wget so that it gets a set of the current ovpn files stored (and constantly changing) at http://vpngate.net ? |
#9
|
|||
|
|||
Make multiple cmd windows default to same location?
Hazuki Nakamura wrote:
Hazuki Nakamura said: I tried heroically to get wget to download the files but you will find it NOT EASY to figure out the syntax for wget. For example, here are three files that can be downloaded today manually: http://www.vpngate.net/en/do_openvpn...&hi d=3510189 http://www.vpngate.net/en/do_openvpn...&hi d=4828153 http://www.vpngate.net/en/do_openvpn...&h id=6262531 But how do you figure out a wget algorithm to download them automatically? There are two solutions but I can't get either to work yet on Windows. 1. Easily close all command windows but the one I want 2. Use wget to get the latest ovpn files for today I don't know wget well but here is the closest I can get to getting it to work on the vpngate.net ovpn files: c:\bin\gnu\wget\wget --wait=3 --random-wait -r -I /en,/common -A do_openvpn.aspx,openvpn_download.aspx\* -nc -nd http://www.vpngate.net/en/ -e robots=off Do you know how to fix that wget so that it gets a set of the current ovpn files stored (and constantly changing) at http://vpngate.net ? I'm thinking you really really need to learn a scripting language :-) One Command Prompt window and a "for loop" in a script, could loop through a set of files, until a successful one is located. Paul |
#10
|
|||
|
|||
Make multiple cmd windows default to same location?
On Sat, 24 Dec 2016 18:22:55 +0000 (UTC), Hazuki Nakamura wrote:
Java Jive said: Find the / create a shortcut that launches the cmd window, and rt-click the link and choose properties, then the layout tab, unselect Let system position window, and choose the location that you want. You can also make choose its size as well. But why on earth are you launching series of window until one works? Perhaps if you explain what you are trying to do, we may be able to solve your problem more directly. For example, you can also set the properties of the shortcut to close the window automatically after the command it was launched to run has finished. I have an extremely simple vpn setup which requires only two things: 1. The opensource openvpn desktop client https://openvpn.net/index.php/open-s...downloads.html 2. Any openvpn configuration file http://i.cubeupload.com/Qi3BHb.jpg In practice, since any one vpn configuration file could be bad (by design), I download scores upon scores of openvpn configuration files at a time and then I doubleclick on them to open up a vpn session. I get those openvpn files from vpngate.net and I use the standard opensource openvpn client. In practice, the openvpn files go stale (on purpose, due to the design of vpngate.net to foil censorship) so I just choose the next, and the next and the next openvpn configuration file, until, after about 10 windows (or so), the connection is good. It's not pretty. But it works. And by design, it has a huge advantage over all other free vpn solutions (astoundingly huge advantages). That's fine except there is only one tactical problem I wish to solve which is to clean up my desktop by deleting the 10 (or so) windows that failed. Currently I do that manually, but if all the cmd windows simply opened up in the same spot, that task would be tremendously easier. So all I ask is that ovpn files open up in a command window whose location is static. Is that too much to ask of windows? Here is a sample openvpn file from vpngate.net today: http://www.vpngate.net/common/openvp..._tcp_1976.ovpn Assuming that you haven't changed the default file association setting for the OpenVPN application, double-clicking on an .ovpn file would open it in Notepad. And only by right-clicking on an .ovpn file then choose "Start OpenVPN on this config file", it would start OpenVPN using that config file. If that is the case, or you've changed the default application for .ovpn file from Notepad to the "openvpn.exe" file, you can set the console window to always show on a fixed position. This will apply to all console windows owned by the openvpn.exe application which are not started by a shortcut file. First, place the OpenVPN console window to the desired position. Next, open its system menu by clicking that its icon on the top-left of window, or right-clicking the title bar. Choose the "Properties" menu item to open the console window's Properties dialog. Switch to the "Layout" tab and in the "Window Position" section, uncheck/untick the "Let system position window" setting. Then press the OK button. The next time you open the openvpn.exe application, its console window will be placed in the configured position. Existing openvpn.exe console windows won't be affected. You may change the other console window settings in the Properties dialog according to your preference. e.g. increase Window Size, Screen Buffer Size, Font Size. |
#11
|
|||
|
|||
Make multiple cmd windows default to same location?
JJ said:
Assuming that you haven't changed the default file association setting for the OpenVPN application, double-clicking on an .ovpn file would open it in Notepad. I don't even know how to change the file association of an ovpn text file; however it should be noted that my .ovpn text files open up in openvpn (which makes total sense) when doubleclicked. I suspect the file association is changed by the installation of the openvpn desktop client. Is there an easy way for me to confirm that for you? And only by right-clicking on an .ovpn file then choose "Start OpenVPN on this config file", it would start OpenVPN using that config file. I understand completely what you are saying, which is that the file association, by default, for an ovpn text file would be the same as for a ..txt file (for it surely is a text file). However, all I can tell you is that, after installing the freeware opensource openvpn client, doubleclicking on an ovpn text file opens it in OpenVPN which is exactly what you'd want it to do. If that is the case, or you've changed the default application for .ovpn file from Notepad to the "openvpn.exe" file, you can set the console window to always show on a fixed position. This will apply to all console windows owned by the openvpn.exe application which are not started by a shortcut file. Ah. That would be a useful solution. I never ever see the openvpn "console" window, as I installed openvpn from the opensource sourceforge repository and never saw the client ever again after installing it. This is as it should be, but looking around, I do where I placed the desktop shortcut into my start menu (which I habitually do for all installations as everything belongs in its place). http://i.cubeupload.com/wqOFQw.jpg Looking at the properties of that shortcut (which was created by the installation program for the OpenVPN desktop client) and looking at the properties for the binary file it references, I don't see any button to set the window location. http://i.cubeupload.com/VbOMTf.jpg First, place the OpenVPN console window to the desired position. Since I never use the OpenVPN console, I first tried doubleclicking on an openvpn file, which opened up a command window in a system default location. Then I looked at the properties of *that* command window: http://i.cubeupload.com/yfvn5j.jpg Digging about in those properties I do see the property: [x]Let system position the window http://i.cubeupload.com/Fl9bqT.jpg Unchecking that option only gives me two options, neither of which seem to be what we want (because I suspect the title will constantly change): [ ] Apply properties to current window only [x] Save properties for future windows *with same title* http://i.cubeupload.com/oF49Qu.jpg However, *that worked*. Woo hoo! All the new openvpn windows are now opening in the *same* spot! Yippeeee!!!!!! Thank you for that wonderful Christmas gift! NOTE: I wish I could actually figure out what the *title* of the window is, but Windows doesn't let you scroll (and it's a long one), which is ridiculous, but it is what it is. |
#12
|
|||
|
|||
Make multiple cmd windows default to same location?
Hazuki Nakamura said:
However, all I can tell you is that, after installing the freeware opensource openvpn client, doubleclicking on an ovpn text file opens it in OpenVPN which is exactly what you'd want it to do. I should be more clear by rewriting that statement, since I have never seen the OpenVPN client GUI since the day the program was installed off the Sourceforge site. Here's that sentence rewritten to be more accurate: "All I can tell you is that, after installing the freeware opensource openvpn client, doubleclicking on an ovpn text file opens it in a "DOS command window" running OpenVPN (which is exactly what you'd want it to do." At that point, your network switches from your ISP without encryption to the VPN with encryption and stays that way until you close that DOS command window. When you close that DOS command window, you immediately (within a second or two) switch back to your ISP without VPN. It's so simple that there really is nothing to do. So that everyone benefits from your help, I will write up a summary so that the next person with the same issue has a ready-made solution waiting for them should they find this thread in their future searches. Thank you for that very nice Christmas present today! |
#13
|
|||
|
|||
Make multiple cmd windows default to same location?
Paul said:
I'm thinking you really really need to learn a scripting language :-) One Command Prompt window and a "for loop" in a script, could loop through a set of files, until a successful one is located. Hello Paul, Your advice is apropos, where I think *everyone* would benefit from a scripting language. In Linux, for example, almost everyone uses a shell script, which is merely stringing along the command they do every day. But on Windows, we are severely limited in what the shell can do, and the syntax is horrendous at best to get anything done in a DOS command window. I realize what you mean is that I should find an *interpreter*, such as visual basic (which I don't know if it's good or not) and then use *that* interpreter's scripting language to string the commands. The pseudocode would look something like this: 10 Execute the next *.ovpn file in the directory 20 Did it start up OpenVPN? 30 If no, then kill the process you started & loop back to 10 40 If yes, then exit (because you are now on VPN) I'm sure something like this should exist, but I think most people on VPN are using a far more reliable configuration file than I am using. What I'm using (vpngate.net) is unreliable on purpose (to foil censors). It's university stuff. But what I have now helps a lot because I can now easily close all those deadend command windows since they're all starting in the same location now! The only bit of finesse left is twofold but they're for another thread: 1. Check to see if the VPN drops (because it does every once in a while) 2. Figure out how to wget the openvpn config files off of vpngate.net |
#14
|
|||
|
|||
Make multiple cmd windows default to same location?
Hazuki Nakamura said:
Is that possible in Windows to get command windows to open in one spot? (I don't start them manually, I start them by clicking on an openvpn file.) SOLVED! Thanks to JJ, Java Jive, Paul, & Char Jackson, we have a simple solution! If you're starting from scratch: a. Install OpenVPN (e.g., into C:\apps\network\vpn\openvpn\.) b. Install shortcut (e.g., to Menu:\network\vpn\openvpn\OpenVPN GUI) c. Obtain *.ovpn text configuration files from http://openvpn.net WIP: Figure out if wget is powerful enough to get them automatically; otherwise, you are forced to obtain them manually with a browser. Then, to set up the command windows to stay in one spot: 1. Doubleclick on any desired openvpn *.ovpn text file. 2. This should run openvpn in a command window. 3. Position that command window where you want it. 4. Right click the title bar of that cmd window & choose "Properties". 5. Click on the "Layout" tab of that properties window. 6. Uncheck the default option "[ ]Let system position window". 7. Press "OK". 8. Check "(o)Save properties for future windows with same title". 9. Press "OK". 10. Now Doubleclicking on *.ovpn files will open them in the same spot! 11. If the first file fails, just doubleclick another ovpn file. 12. Move the last (working) window & just successively X the others! This solution allows us to work our way though multiple stale openvpn config files until a working file is found. Once a working openvpn config file is found, that working window can be moved to the side and the rest of the windows easily closed by left clicking on the [X] box at the top right of the command window (which will stay in the same place for all the stale windows). Of course, a better solution would be to figure out how to get OpenVPN itself to run down the list of openvpn config files, and to get wget to obtain the latest list of openvpn files (so as to have far fewer stale files), but this method works at present. If anyone improves the method, that will be helpful to everyone! |
#15
|
|||
|
|||
Make multiple cmd windows default to same location?
On Sun, 25 Dec 2016 16:01:14 +0000 (UTC), Hazuki Nakamura wrote:
Unchecking that option only gives me two options, neither of which seem to be what we want (because I suspect the title will constantly change): [ ] Apply properties to current window only [x] Save properties for future windows *with same title* I just noticed. My system no longer prompt me that dialog. ?(o.O)? Well, no matter. I could simply change the setting back if I need to, or delete the unused saved window titles in the registry directly. |
|
Thread Tools | |
Display Modes | Rate This Thread |
|
|