How do I open a WinSCP GUI session from command line? - winscp

If I have a session named "hpc" and I run:
winscp hpc
I get into command line mode. How do I run the GUI and open a session from the command line (Windows)?

WinSCP has two executables, winscp.exe and winscp.com. The winscp.exe is GUI, while the winscp.com is command-line.
If you use just the winscp, due to an extension precedence in Windows, the .com wins. Make sure you use a full GUI executable name:
winscp.exe hpc
References:
https://winscp.net/eng/docs/executables
https://winscp.net/eng/docs/commandline

Related

How can I launch gitahed from terminal?

I enjoy using gitahed, and I would like to add a shortcut to lauch it, with github desktop I use github-desktop, but I can do the same with GA?
How can I launch gitahed from terminal?
GitAhead has a Terminal panel at Tools->Options. It has a button to install command line tools. It really just creates a symlink to the GitAhead binary in /usr/local/bin. If that doesn't work for some reason, you can create the symlink yourself or an alias. See command line options by running with the --help flag. There are only a few at the moment.

How do I create a shortcut for a command line command in Raspbian Stretch?

I am attempting to install RetroPie as an app on Raspbian Stretch and I am done except for creating a desktop shortcut for it. The problem is that the only way to open RetroPie seems to be running a command in the command line. I can’t do it in terminal because it gives me an error saying that it can’t initialize the window. Is there a way to run a command line command as a shortcut or am I going to have to find another way of doing this?
P.S. Here is the tutorial that I followed to install RetroPie:
https://www.makeuseof.com/tag/install-retropie-app-raspberry-pi/
Probably your shell (on the raspberry) is GNU bash. So read the manual of GNU bash.
You probably want (once) to edit some Bash startup file (such as ~/.bashrc) to define functions and aliases there, and you could add executable shell scripts somewhere in your $PATH. I recommend having a $HOME/bin/ directory containing your scripts and executables, and have $HOME/bin/ early in your $PATH.
I can’t do it in terminal because it gives me an error saying that it can’t initialize the window.
Perhaps you need some display server (such as Xorg or Wayland) running (with a desktop environment or a window manager). You could run Xorg on your PC (on which you could install Linux) and connect to the raspberry using ssh -X then remote applications running on your Raspberry are displayed on your PC. IF your Raspberry is directly connected to a screen (via HDMI) you might run some Xorg server on it.
Is there a way to run a command line command as a shortcut
Yes, by making a shell alias or shell function or shell script. You need to understand how they work and change or create some appropriate file using some source code editor (I recommend GNU emacs, but the choice is yours and you might use any other editor such as vim, gedit, etc...): functions and aliases could be defined in your ~/.bashrc; shell scripts would usually have their own file with a shebang under your $HOME/bin/...

Can't run .run file using cygstart

I am trying to run a .run file in cygwin, but I always seem to get this error:
Unable to start '~.run': There is no application associated with the given file name extension.
I needed to be a superuser, so I tried using the command: cygstart --action=runas "$#"
I read somewhere that cygstart is for invoking registered Windows handler, so this may be the problem, but I am unsure. Is there any way that I can run my .run file as a superuser using cygwin?
Well, as has been said, no application is associated with .run files on your
system. So you can do that one of two ways
Call the file with the program, example
cygstart notepad.exe ~.run
Tell the registry what to do with unknown extensions
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Unknown]
#=""
[HKEY_CLASSES_ROOT\Unknown\shell\Open\command]
#="notepad.exe \"%1\""
This question is not related to Cygwin but rather to Windows. cygstart works the same as Windows' start. That means, if you use [cyg]start file.extension it works very similarly as if you double-click on that file in Windows Explorer.
Therefore if you configure Windows to do what you need when you double-click on your *.run file, cygstart will work fine too.
I think that easier is to use appropriate extension which Windows already knows. It depends on what you have inside your *.run file. If it's executable, use exe extension, if it's batch script, use cmd or bat, if it's JavaScript, use js etc.
If you use Linux or some derivation, you need to execute the .run file with an absolute path, even if you have already navigated to the appropriate directory containing the file. See here:
http://the-chronicon.blogspot.com/2011/08/execute-run-file-in-current-folder-from.html

silent mode installation of setup files in Windows server

I want to install some softwares such as notepad++, safari etc in silent mode using command prompt. And my OS is win2k8r2.
I placed two executables npp.6.3.3.Installer.exe and SafariStup 4.2.exe in a folder in c drive and used command line arguments as below..
c:\AllFiles>npp.6.3.3.Installer.exe -s
it executes, but shows dialog boxes that was not expected.Please help...
Each program is going to be different, some don't even support silent installations. From command line if you do yourfile.exe /? it should tell you available options.
For Notepad++, I recommend simply downloading the ZIP package (not the EXE installer), unpacking it to the desired location, and adding a Start Menu shortcut.
You don't need to install it per se.

How to add shortcut key by bash script

We are working on a kiosk mode in Linux Ubuntu. We would like to define a shortcut by command line (bash script). Is this possible? We would like to setup our kiosk mode automatically by a bash script. So creating a new shortcut via Compiz isn't possible.
Any ideas?
The shortcuts usually depend on the window manager you're using. If you're using Ubuntu you should have Gnome as default windomanager so you could use the Gnome Control Center to set the shortcuts you want.
Another way, is use a tool like Xbindkeys which is indipendent from the window manager and reads the key configuration from a simple text file usually ~/.xbindkeysrc.
So you could install Xbindkeys in your system with:
sudo apt-get install xbindkeys
Then in the bash script you could add a new entry in the ~/xbindkeysrc config file to add your shortcut.

Resources