I tried opening google chrome by typing "chrome" into the run command(windows + R), but it does not open.
You can just type start chrome onto your cmd prompt to start chrome from command line
goto environment variables
This PC->Properties->Advanced System Settings (on left pane) -> environment variables-> new
and type "chrome" (without quotes) in variable name and
C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
in variable value as below
Click Ok and close the windows.
That's it.
Press Window key+R
and type "chrome" (without quotes) and hit enter.
Chrome will open
Related
I'm trying to run the Api Explorer in LocalHost But it always show the Error
The API you are exploring is hosted over HTTP, which can cause problems.
So I follow the instruction
Go to File Explorer then paste this to address bar >> C:\Program Files (x86)\Google\Chrome\Application (or just go to where you can find your chrome.exe)
Right click chrome.exe > send to > Desktop (Create Shortcut)
Go to your desktop then find the chrome shortcut you've created.
Rename it to ChromeForTesting (this step is optional)
Right click the shortcut, then Click Properties
At the "Target", paste the following at the end of the link
--user-data-dir=test --unsafely-treat-insecure-origin-as-secure=http://localhost:8080
so Target should look somewhat similar to this
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir=test --unsafely-treat-insecure-origin-as-secure=http://localhost:8080
Click Ok..
During testing close all of your opened google chrome browser.
Then double click ChromeForTesting shortcut (the one you've created), when a prompt appears, just click ok..
But After compelting this When I run that shortcut it will give the error
you are using unsupported command line flag --user-data-dir=test --unsafely-treat-insecure-origin-as-secure=http://localhost:8080
I also try to click load unsafe script but this is also not working.
Here is screen shot.
I'm trying to get the devtools to open automatically when starting chrome from a shortcut with a command line switch --auto-open-devtools-for-tabs.
i.e. the path of that shortcut is: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -incognito -auto-open-devtools-for-tabs (or --auto-open-devtools-for-tabs).
But both don't seem to open the dev tools, neither does entering in the cmd chrome.exe -auto-open-devtools-for-tabs (or --auto-open-devtools-for-tabs), of course when in Chrome's folder.
Maybe I'm doing something wrong?
The command is from:
http://peter.sh/experiments/chromium-command-line-switches/#auto-open-devtools-for-tabs
https://stackoverflow.com/a/41452619/4279201
This flag only applies when you open the first chrome instance.
Close all chrome windows
Run "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -incognito -auto-open-devtools-for-tabs
If you want your daily browser, with all tabs but without devtools, at the same time as you're debugging a website with devtools automatically opening, you have to run them separately.
Alternative: Stable + Beta
One example is to use example Chrome stable and Chrome beta.
"C:\Program Files\Google\Chrome\Application\chrome.exe"
"C:\Program Files\Google\Chrome Beta\Application\chrome.exe" --auto-open-devtools-for-tabs
Alternative: data-dir
"C:\Program Files\Google\Chrome\Application\chrome.exe" -incognito --auto-open-devtools-for-tabs --user-data-dir="%APPDATA%\ChromeDevOrAnyName"
Is it possible to open a command prompt through chrome link/button and passing a value/url. I am looking for a solution to open a local file through chrome. I am okay if the user manually presses the run command to open but alteast the cmd should open with passed values.
Google repeatedly changed the path to the .exe of Chrome. Sometimes it's hidden in %APPDATA%, in Version 35/36 they changed the path back to program files. There are also differencies across the Windows versions.
Where is Google Chrome located in Windows 10?
Please see the screenshot which gives you the ability to seek for the current path of google chrome path or any other application
Task Manager - Windows 10
Windows 10:
%ProgramFiles%\Google\Chrome\Application\chrome.exe
%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe
%LocalAppData%\Google\Chrome\Application\chrome.exe
Windows 7:
C:\Program Files (x86)\Google\Application\chrome.exe
Vista:
C:\Users\UserName\AppDataLocal\Google\Chrome
XP:
C:\Documents and Settings\UserName\Local Settings\Application Data\Google\Chrome
There are also Registry Keys and environment variables to use. Check out this post for universal use for programming.
Chrome can be installed in various places on Windows, for a given user or "all users", in which case it's installed in Program Files.
To determine where it is programmatically:
Batch file:
set exe=
FOR /F "tokens=2* skip=2" %%a in ('reg query HKCR\ChromeHTML\shell\open\command /ve') do set exe=%%b
set exe=%exe:"=%
set exe=%exe:~0,-6%
PowerShell:
(gp Registry::HKCR\ChromeHTML\shell\open\command)."(Default)" -match '"(.*?)"' | Out-Null
$exe=$matches[1]
C#:
var exe = System.Text.RegularExpressions.Regex.Match((string)Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(#"ChromeHTML\shell\open\command").GetValue(null),
#"""(.*?)""",
System.Text.RegularExpressions.RegexOptions.None)
.Groups[1].Value;
Python
import winreg
import re
command = winreg.QueryValueEx(winreg.OpenKey(winreg.HKEY_CLASSES_ROOT, "ChromeHTML\\shell\open\\command", 0, winreg.KEY_READ), "")[0]
exe=re.search("\"(.*?)\"", command).group(1)
VBA / VBScript
Set objShell = CreateObject("WScript.Shell")
cmd = objShell.RegRead("HKCR\ChromeHTML\shell\open\command\")
exe = Mid(cmd, 2, 999)
exe = Left(exe, InStr(exe, Chr(34)) - 1)
The answer I am writing is applicable for any software/application installed on windows.
Windows 10
Click on windows button and search for the application, in this case Chrome.
Right click on application name and click on "Open file location".
You will reach at location of the shortcut of that application. Again right click on the application shortcut and then click on "Open file location" and you will get the path from top url/path bar of explorer or you can click on properties to get the path as shown in image.
And you will get your path for desired application from tab shown in image.
PS: Doesn't works for apps installed from windows store.
Right click on the sub process to see the open file location :
Screenshot
To find the location of Google, type the following command...
chrome://version
And then look for Command Line on the left side of the screen.
I found something in the Registry when I installed Chrome Canary at the same time.
in a batch file, using chrome.exe it always opens Canary...
then I change from:
Equipo\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe
"C:\Users\heratess\AppData\Local\Google\Chrome SxS\Application\chrome.exe"
To:
Equipo\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe
C:\Program Files\Google\Chrome\Application\chrome.exe
and it worked for me.
maybe it could help you.
I've had this problem for ages, and it's SO ANNOYING.
Suppose I want to run mysqldump.exe... here's my process: Start->run, type "cmd" ... dir into directory after directory until I finally get to c:/program files/mysql/bin/then I can FINALLY call "mysqldump.exe"
I don't mind using Windows Explorer to get to c:/program files/mysql/bin, but then I can't freaking open up any of the .exe files in a shell, and I can't open up shell with the directory being that one.
How can I do this?
This is what I do for those type of commands:
Drag a copy of the "Command Prompt" shortcut onto your desktop.
Open the properties of the shortcut.
Change the Target: field to: %SystemRoot%\system32\cmd.exe /k mysqldump.exe
Change the Start in: field to: c:/program files/mysql/bin/
Hit Ok, then rename the short cut from "Command Prompt" to "Mysqldump".
Then just double click the icon whenever you need that command. The "/k" option for cmd.exe leaves the window open.
Microsoft released a powertoy for Windows XP called Open Command Prompt Here. If you're using Vista, all you need to do is hold shift and right-click.
here's my process: Start->run, type
"cmd" ... dir into directory after
directory until I finally get to
c:/program files/mysql/bin/ then I can
FINALLY call "mysqldump.exe"
Why not just the following?
c:
cd "c:/program files/mysql/bin"
mysqldump.exe
Better yet, put this in a batch file and execute it.
You can also create a shortcut for cmd.exe and set the "Start in" directory to "c:/program files/mysql/bin".
You can download an add-in so that you can right click on the folder and open a command prompt. Saves a lot of time and you say you dont mind navigating to the location.
http://download.microsoft.com/download/whistler/Install/2/WXP/EN-US/CmdHerePowertoySetup.exe
A nice little trick is that the icon in the adress bar of explorer could be dragged to a command line window and it insert the full path at your current cursor position.
It doesn't work in vista but if you SHIFT-RightClick on a folder you have an "Open Command Windows Here" option that appears.
Under xp you could have it by saving this as a .reg and executing it :
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\cmd]
#="Open Command Prompt Here"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\cmd\command]
#="cmd.exe /k pushd %L"
Just use the explorer to navigate to the bin or any directory. then enter cmd at the address bar und hit return. the command line with start at this location.
You can do it with python:
If you don't have activepython already, download from ActiveState's Website. Next, run PythonWin and create a new script. Write the following:
from subprocess import *
Call("c://program files//mysql//bin//mysqldump.exe")
Save the script somewhere. When you want to run it, just doubleclick. There are easier ways if you like writing batch files, but Python is more succinct than even windows for this case.
Just put c:/program files/mysql/bin/ into your path...
Then you can run mysqldump.exe directly without even opening a cmd prompt by typing it into " Start > Run "
I was using the MS PowerToy for a while but moved on to the open source Open Command Prompt Shell Extension because of the key feature:
(copied verbatim from the website)
The ability to open a command prompt in the directory that you are currently in by right-clicking on any empty screen space in the directory. This eliminates the need to navigate up a level in order to open a command prompt in the current directory.
Having to actually click on a folder to open the command prompt using the MS tool was a annoyance for me... especially since I always need to run command line tools on my current directory at the time.