Linux Mint 16 - How to launch script from desktop without "Run in Terminal, Display, Cancel, Run" prompt - linux-mint

Is it possible to remove the "Run in Terminal, Display, Cancel, Run" prompt that I get each time I double-click to run a script from the desktop?

You can also do right-click/Create Launcher on the desktop to create a launcher for your script -- then when you double-click the launcher it will just run without giving you that prompt.

I managed to find an option within Nemo --> Edit --> Preferences --> Behaviour --> Executable Text Files --> "Run executable text files when they are opened."

Related

How to build AHK scripts automatically on startup?

Each time I restart my computer, I have to rebuild all my AHK Scripts so the keyboard shortcuts will work.
For instance, I have a script that assigns Ctrl+j to set up an instance of the MEAN stack and open my web site. After restarting my computer, pressing ^j does nothing until I go into Sublime and ^b (Build). I could build from AHK, but I do a lot of work in Sublime, so it's easier to build there.
How can my AHK Scripts automatically build on startup?
What I've tried so far:
Looking to build a post startup, startup script: This Is concerned with using an AHK script to start many programs on starup. I use Windows' Task Manager > Startup to do this, thus has nothing to do with making. I want to not have to rebuild all my scripts after every restart.
Windows 10 - run script on windows startup problem: This assumes the start script is already written and implemented. However, it doesn't appear to give the script.
AutoHotKey FAQ: I eventually found a solution here, but it took a long time to dig through the questions so I figured I'd post a question anyway to help others who run into this.
Simply add a shortcut (don't need to be the actual file) of your script in the Windows 'Startup' folder.
Three ways to get there:
1- In Windows Explorer, go to %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup (for current user startup list) or %ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Startup (for every user startup list)
or
2- Open Windows' Run application (Windows + r) write shell:startup (current user) or shell:common startup (every user) in the edit field and click on the 'ok' button.
or
3- Start > Programs > Startup (old Windows versions)
In AutoHotKey you can access this folder with the Built-in Variables %A_Startup% (current user) or %A_StartupCommon% (every user)
To create the (current user) shortcut automatically from your script, use the following line:
FileCreateShortcut, %A_ScriptFullPath%, %A_Startup%\shortcutname.lnk
To do the same for all users, use this line instead:
FileCreateShortcut, %A_ScriptFullPath%, %A_StartupCommon%\shortcutname.lnk
(in the case of having a file with the same name in the folder, the file would be overwritten)
ps: Win10 blocks scripts in startup with AHK running as admin... read the comments of this post for extra info.
Run at startup in Windows 10:
Compile the script to *.exe
Put the shortcut of that exe in startup folder "%appdata%\Microsoft\Windows\Start Menu\Programs\Startup"
That's all. Do NOT set it to run as admin. Programs in Win10 don't run at startup which are marked as run as admin.
Run Script as admin at Startup in Windows 10:
Go to ahk script and mark it run as admin.
Create the VBScript using a text editor
'put it in startup folder to run the mentioned ahk script at startup
Set WshShell = CreateObject("WScript.Shell" )
WshShell.Run """C:\Users\jerry\Downloads\scripts\some_script.ahk""", 0 'Must quote command if it has spaces; must escape quotes
Set WshShell = Nothing
Replace C:\Users\jerry\Downloads\scripts\some_script.ahk with the path to your script with extension and save it as .vbs.
Place this .vbs script at startup folder %appdata%\Microsoft\Windows\Start Menu\Programs\Startup
PS: My fav AHK scripts: https://gourav.io/blog/autohotkey-scripts-windows
Open note pad or any other text editor
write Start "" "C:\ahk\yourdirectory\yourahk.ahk"
press save as
navigate to %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup
name the filename anything.bat
As a Windows 7 user, I have limited experience with Windows 10. I have heard that W10 can be finicky with regard to running programs underground administratie or limited user. In W7, you just add the .AHK file link to the startup dir.
A simple solution without writing any code, using the Windows Task Scheduler, set the script to start when the user logs on. If it is set to system startup it will error because it is too early.
To allow the script to automate administrative programs without running as admin, here're the required steps:
When installing AHK, check the "Add 'Run with UI Access' to context menus" option.
After installation, find AutoHotkeyU64_UIA.exe on your disk.
Open the .ahk script's properties, change the "Open with" option to the AutoHotkeyU64_UIA.exe you just found.
Create a shortcut to this script.
Open %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup in the file explorer.
Move that shortcut to this folder.
And you're done.
How does it work?
The "Add 'Run with UI Access' to context menus" option provides a workaround for common UAC-related issues by allowing the script to automate administrative programs without running as admin.
Reference: Run with UI Access.
Open windows run (win+r) and type “shelll:startup”
Copy paste the ahk file into there
Close the folder
And that‘s all!

Disable Terminal Window in Linux

Every time I start the installer under Linux, a terminal window opens with the message "Starting Installer ..."
Where is the option to disable this terminal window?
The installer is a shell script. The desktop environment opens a terminal if you execute a shell script. In some desktop environments you can disable this on a per-executable basis.
In any case, this is a manual process that cannot be configured in install4j.

wrapper | OpenSCManager failed - Access is denied. (0x5)

I am trying to install Archiva on windows 8.1 pro (64 bit) and I am continuously getting the same error as below
wrapper | OpenSCManager failed - Access is denied. (0x5).
I logged in as administrator only. But still I am getting the same error. Most of the answers for the same problem I am seeing it for VISTA and 7 etc.. But not for Windows8.1 Pro (64 bit)
You need to run that command as an administrator.
Right-click on the command prompt entry in the start menu / task bar
Select "Run as Administrator"
Navigate to the Archiva installation directory
Then run:
bin\archiva install
net start archiva
Click on Start
Click All Programs
Click on Accessories
Right click on Command Prompt icon
Click Properties
Click on the Shortcut tab on the top
Click the Advanced button at the bottom
Click on the check box that says:
Run as Administrator
Click OK
Go to the folder having the batch file
Enter the command which was giving
Access denied
error
It will execute successfully.
I'm not sure this is supported by the wrapper.
Maybe the way to go for you is to use the war within a servlet container.
Have a look here: http://archiva.apache.org/docs/2.1.0/adminguide/webapp.html
HTH
pleas open Command Prompt run as administrator mode and then go to
{tinydms-home}/bin
then
tinydms install
to installing
Type cmd as shown below:
Run as administrator as shown below:
Sometimes, reopening the console or restarting the computer solves this problem for me. I hope it works

To build a script from Eclipse to run commands in cmd

I am using a set of commands to build my project in a expanded mode to deploy it in weblogic so each time i need to go to cmd and change directory to my project directory and run the command 'client dev fullexpanded' .
I want to make a script to run these commands which i running through cmd in my eclipse so each time i dont have to open cmd and write these commands
Add the script as an External Tool (Program type) and you'll be able to fire it off from the toolbar.

Set the default directory in mac terminal

I only use terminal (mac) for git, and I only use git for one directory. Is it possible to set the default directory (the directory when terminal is opened) to the directory where I use git, and if so how?
As of Mac OS X Lion 10.7, Terminal supports Resume and by default will automatically restore terminals you had open when you quit, restoring their working directories. So, you can just open a new terminal and cd to your git directory, then leave the window open when you Quit. Each time you reopen Terminal, the terminal will be there, in the same directory. (This works for bash by default. If you're using some other shell, you'll need to adapt the code in /etc/bashrc to your shell. I've posted code for zsh in my answer to Resume Zsh-Terminal (OS X Lion) on SuperUser.)
You can also arrange for Terminal to start a shell in a particular directory. You can customize or create a "Settings Profile" to issue a "cd" command when it starts:
Terminal > Preferences > Settings > [profile] > Shell > Startup > Run command
Enable "Run command" and "Run inside shell", then set the command to cd your_git_directory. When you open a new terminal with that profile, it will go to your git directory.
I recommend you Duplicate the current default profile (if you've never changed it, the default is "Basic") using the Action ("gear") menu at the bottom of the profiles list, then customize that profile.
Finally, to have it automatically open a terminal with this profile when you open Terminal, set
Terminal > Preferences > Startup > On Startup, open
to your custom profile. (On Lion, Resume will restore windows that were open when you quit, rather than perform the startup action. As I mentioned, you can just leave this terminal open when you Quit and it will be restored when you open Terminal again. Or, you can press the Option modifier key when quitting; the Quit menu item will change to "Quit and Discard Windows" and the next time you open Terminal it will perform the startup action.)
I like to have 'New windows open with: Same Working Directory'. All answers I've found for this question (many SO's) will break that setting by always going to the new home directory. Below is what I use at the top of my .profile (or .bashrc, etc).
export START="/Users/michael/my/starting/directory"
if [[ $PWD == $HOME ]]; then
cd $START
fi
This will see if you are in your HOME directory only on launch, and if so change to your new START directory. That way new windows won't automatically run this command.
The only caveat is if you're in your actual HOME directory and open a new window, it will take you to START. Which is expected.
Try echo "cd $directory" >> ~/.bash_profile
If you are using for example ZSH,
just add to your config file .zshrc this string:
# Working directory
cd ~/Desktop
or for instance:
# Working directory
cd $HOME/Desktop
Change path with your preference.
It just will return command to ZSH, you won't see it in terminal and it will start with your chosen path.
Use a Window Group. Arrange your shell window(s) as you'd want them to be on startup - cd to the directory you want in each, set colors, Shell--Edit Title, etc. Then go to Window--"Save Windows as Group...". Give it a name, check "Use window group when Terminal starts". Next time you start, this arrangement will be your starting point.
I modified #Michael Ozeryansky's answer to solve the caveat he mentioned:
The only caveat is if you're in your actual HOME directory and open a new window, it will take you to START. Which is expected.
To make your second terminal window tab starts from the Home or Any other dir:
export START="/Users/michael/my/starting/directory"
export DIR = "path/to/directory"
if [[ $PWD == $HOME ]]; then
cd $START
else
cd $HOME // or any other dir: cd $DIR
fi
If you modify the .zshrc file, the “New Terminal in Folder” Service shortcut will not work on Mac. I do not recommend.
On the iTerm2 terminal, I do the following:
Profiles --> Open Profiles --> Click the Edit Profiles button
Go to the Profiles tab --> General
Update the Working Directory