Closing CMD automatically closes another program - cmd

I've been playing around with EnvVar Paths so I can easily start programs from the cmd prompt.
Shortcuts from programs I wish to open using the cmd are copied into a folder X and linked in System Env Paths, and I'm able to execute them using:
> start <shortcut>
However, I'm facing a strange problem when I try this with mySQL Workbench (shortcut is called 'sql.lnk'). After opening the program using
> start sql
anytime I close the cmd prompt, the mySQL Workbench window automatically closes as well.
Does anyone know why this is? I've tried with multiple programs (word, excel, chrome), and none of them give me this behavior.

Related

Reuse window / tab when file is already open

I want to set a global shortcut that will open a certain file. When there already is a gvim window that has that file open, I want it to focus on that window, and select the tab with that file. If there isn't, I want it to be opened in a new gvim window, regardless of whether there already are other gvim windows.
I can do part of this with --remote and --servername, but I can't find a way to detect whether there already is a remote server running with the name I use, so I can't quite get everything to work together to come to what I described above.
OK, turns out most can be done using the default behavior of --remote-silent. The whole setup is a matter of making an AutoHotkey script like this:
#!^+1::
Run "c:\Program Files (x86)\vim\vim74\gvim.exe" --servername org --remote-silent %DROPBOX%\org\TODO.org
WinActivate, TODO.org
Return
AHK is needed for the global hotkey as well as activating the window; vim (using --servername and --remote-silent) will start a new session called 'org' if there isn't one yet, and start it otherwise. It even gets the tab activation right when there already is a server called 'org' but if that server has another tab active.

can I save my current dir and windows in cmder?

How to save my current setup in Cmder
I use Cmder on windows for all of my deving. I use a separate front and back end for my MEAN applications and also gulp for javascript minification. Also to run mongodb I use the cmder.
My window looks like this once everything is running
Every time I start work on my project I have to open all these windows and run the cd commands to get to their respective folders. I was wondering if there was a way to save the session so that I can have all my windows open automatically in their correct dir?
Use startup settings
You can write startup settings that allow you to execute a series of tasks on startup under
Settings > Startup > Tasks
Here you can define what shell starts and what tasks it should perform, with this you can open new tabs and cd to where you need to work.
A simpler version of this is to just go as far as
Settings > Startup
and find the radio button "Auto save/restore opened tabs", this will at least open up you Cmder where you left off, without the cmd's running.
Hope this helps people who use many windows on startup.

How to Launch a Metro App from Microsoft Access VBA on Windows 10 Computer

I have a situation in which I wanted to utilize the camera app in Windows 10 from my Microsoft Access program. Normally I could just send a command to execute the program's executable, but with the metro app there is no straightforward executable.
The basic code I use is this:
Shell """" & PthToExe & """", vbNormalFocus
PthToExe is the path name for the executable.
I looked around a decent bit, but was unable to find any simple solutions and ended up coming up with my own. My solution is to make a shortcut link to the camera application and then to launch the link.
In order to make a shortcut link in Windows 10, you can click on the start button, go to "All Apps", find the app you want (in my case "Camera"), and then click and drag it to the desktop.
Now that you have a shortcut, you can launch the shortcut from a command line. (So my shortcut doesn't clutter up my desktop, I dragged it off my desktop and into a folder on the "C" drive.)
Type the path into a command prompt like this and hit enter to test launching your app: C:\GJ\Camera.lnk
So that solves the problem if you wanted to launch from a command line. For some reason, though, Access would not accept that command. The way I got around it was I put the command in a batch file (Edit: Alternatively, see HansUp's comment). To do that, you just need to open notepad, type in the same thing you typed in the command prompt, save the note pad document, and then rename the document to have a .bat extension.
You can then execute the .bat file from Microsoft Access as follows:
Shell "C:\GJ\OpenCamera.bat", vbMinimizedNoFocus
Note that normally, I use vbNormalFocus when running the shell command, but in this case, it is desirable not to see the little command prompt open before the actual program opens.

How can I see which processes/programs are sending/recieving data over internet in XP?

Is it possible to write a script to see which processes/programs are sending/receiving data over the internet in Windows XP? I have full administrator rights and I want to find a way to monitor data exchange on my machine without installing any additional software.
Step One: Windows XP
Open up the Run box by pressing the Windows key and R at the same time.
Put in CMD and press OK. The command prompt window will open up:
Step Two
In your open Command Prompt window, enter the following:
netstat -b 5 > activity.txt
and hit enter. (Note: to paste something into Command Prompt, you'll need to right click and click paste.)
If you forgot to run the prompt as an administrator (like I did in the screenshots above), just redo step one You can tell when it's running as administrator because instead of saying C:\Users\Username it says C:\Windows\system32.
If you've pasted the code right, a blinking cursor will... blink.
After a few minutes, press Ctrl+C. That'll stop the command.
Now type in command prompt activity.txt to open the log:
When you press Enter, your default text editor-probably Notepad-will open:
Now, scroll through the lists. You'll see that it's mostly your browser-but some times, there are programs like Google Talk's webcam program installed that call home even when you aren't using them.
Now that you've found any and all culprits that are programs accessing the internet (with and without your knowledge), you can either close them from the Task Manager or even uninstall them.

New OSX User: Opening up a new terminal window in current space(?)

I'm just meddling with OSX after a few years on Linux. There's a lot that I'm liking, but one thing that's slowing me down is that if I run the 'terminal' command via shortcut/spotlight/quicksilver, it whisks me off to any existing terminal in whatever space already has a terminal instance open.
I regularly like to pop up a terminal, run a quick command and then close it again, all the while staying in whatever desktop space I happen to be on.
...So, how do I do that on Mac?
Cheers...
Go to System Preferences -> Exposé & Spaces -> Spaces and check When switching to an application, switch to...
Download this tool called Visor
It lets you quickly get a tabbed drop down terminal using a hotkey like Ctrl-`.
Insanely convenient for working in the shell.
Try this tool: https://github.com/nmadhok/OpenInTerminal
This is a really handy tool for programmers on Mac as it lets you open the folder directly in Terminal. You can select multiple folders to open them in multiple terminal windows. You can also select files to open the parent directory in Terminal. This application works with Finder as well as without Finder which is a plus!

Resources