# Tag Info

68

The command line argument you're looking for is --profile-directory=Default. Here's the complete command line for Mac OS X: open -a "Google Chrome" --args --profile-directory=Default And for Linux: google-chrome --profile-directory=Default It expects the internal names of the profiles: My second profile, named "Lemonade" by Chrome, would be ...

65

You have basically two options: Option 1: Use Automator to create an application that in effect launches Chrome with command line arguments. Start Automator and select to create an Application. Double-click Run Shell Script in the Library/Utilities folder and replace the text content — cat — with the following: open -a "Google Chrome.app" --args ...

52

Have you tried "c:\path\to\exe\program.exe" -option1 -option2 Only the program path and name need to be enclosed in quotes.

48

Call the command like so: mkdir -- -a The -- means that the options end after that, so the -a gets interpreted literally and not as an option to mkdir. You will find this syntax not only in mkdir, but any POSIX-compliant utility except for echo and test. From the specification: The argument -- should be accepted as a delimiter indicating the end of ...

34

In !*, ! is the history expansion prefix, and * is the word designator that means all arguments. You can memorize the general syntax as bang-line-colon-column (!line:column). There are many possible shortcuts: the default line is the previous line, the default column specifier is “all”, and you can leave off the colon if the column specifier is non-numeric ...

28

You can do that using Process Explorer. Just hover with your mouse over a process to see the command line arguments used to start it: Alternatively, you can open the properties of the process and inspect the command line right there:

23

start /b "" "c:\Program Files\Oracle\VirtualBox\VBoxHeadless.exe" -startvm "debian604 64" If you read the parameter list with start /?: START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED] [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL] [/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] ...

21

GUI method with proper icon Type chrome://settings/ in address bar (or Menu > Settings) Scroll down to Users section Select the user marked (current) & click Edit button Now click Add desktop shortcut Optional Switch to any other profile & repeat steps 1-4 This creates a shortcut icon to your profile with the correct picture in the icon too. ...

20

You can do it without Process Explorer, too, using Windows' WMI service. Run the following from the command prompt: WMIC path win32_process get Caption,Processid,Commandline If you want to dump the output to a file (makes it a bit easier to read), use the /OUTPUT switch: WMIC /OUTPUT:C:\Process.txt path win32_process get Caption,Processid,Commandline

20

The simplest way that should work with any reasonable program is to use a relative path name in front of the -, e.g. mkdir ./-a will create a directory called -a in the current working directory. The most common example of using this "trick" is when you want to remove a file which begins with a dash, so you can do rm ./-a.

12

When they're not quoted, there is no difference between $@ and$*. Both are equal to $1$2 … But don't do this. With double quotes, "$@" expands each element as an argument: "$1" "$2" … while "$*" expands to all elements merged into one argument: "$1c$2c..." where c is the first character of IFS. If you unset IFS, c will be a space. You ...

12

Is this what you are looking for? RUNAS Execute a program under a different user account. Syntax RUNAS [/profile] [/env] [/netonly] /user:user Program Key /profile Option to load the user's profile (registry) /env Use current environment instead of user's. /netonly Use the credentials specified only for remote connections. ...

12

Place the switches after the quotes. Only the program path is kept in quotes due to spaces in the path. Something like My Documents will not resolve properly due to the space between the words, so quotes are needed. This is also why you probably won't find a program with multi-word switches (that are seperate) such as --example switch. You will usually see ...

12

Originally there were only single-character options. Some programs took multiple-character options, but still with a single dash. AFAIK double-dash multiple-character options come from GNU; they were introduced because they are more readable and often more memorable (and you can have more than 52 of them). Many programs now have both: short options for when ...

11

To remove a file named -x, use rm -- -x (-- means end of options) or rm ./-x.

10

I think you want 'Process Substitution' http://tldp.org/LDP/abs/html/process-sub.html. It also works on zsh, though it has more options and the syntax may be different. It creates a pseudo file (/dev/fd/something) for each substitution. It's pretty useful. The command can only read as a stream, meaning it can not go back and forth with fseek. It needs to ...

9

It is fairly common to ask this type of question in interview settings. A common way to handle files with dashes is either: $rm -- -f$ rm ./-f

9

If I understand what you are looking for try dir/s/b *.bat If that works then redirect it into a text file.... dir/s/b *.bat > textfile.txt You may also find it useful to have a list of command line switches for the DIR command.

9

batch, unfortunately, doesn't have a builtin getops function like bash does. However, you could implement your own poor-man's variant: :GETOPTS if /I %~1 == --age set AGE=%2& shift if /I %~1 == --gender set GENDER=%2& shift shift if not (%1)==() goto GETOPTS

8

Can you do it with Powershell? or does it need to be batch? Powershell makes it nice and easy, you just need to add something like this at the top of your script, and then you can call each parameter in any order param ( [string]$Age, [string]$Gender ) You can do it with batch, but it will require lots of parameter checking.. Here's a few links of some ...

8

You could write a script that launches Chrome, but that wouldn't be the application icon in the dock, and it would cause a separate Chrome icon to appear. So you'll have to create an application package. First, make a copy of your Chrome app. Then, there are two approaches that might work; I'm not sure which will play better with Mac OS X and/or Chrome's ...

8

The reason people use xargs in combination with find is that multiple file names will be passed to the same program invocation of whatever program xargs launches. For example, if find returns the files foo, bar, and baz, the following will run mv only once: find sourceDir [...] -print0 | xargs -0 mv -t destDir Effectively, it calls mv like the following: ...

8

The (deprecated) MSTSC /console switch is now called the /admin switch: In both Vista SP1 and Windows Server 2008, the Remote Desktop Program has been updated to version 6.1 (6.0.6001) and one of the changes is that the functionality previously associated with the /console switch is now called the /admin switch. By using it you're connecting to the ...

7

Another, albeit less convenient method of choosing which profile will launch is to edit the Local State file in the Chrome User Data directory and search for "last_used": if you change the value it lists to a different Profile that's the one that will open the next time you launch chrome normally (unless of course you're using the switch mentioned above). I ...

7

The following works on Windows 7. It may work on others. Folder Options has three tabs. You can choose which tab is selected when it is opened: General Tab - C:\Windows\System32\rundll32.exe shell32.dll,Options_RunDLL 0 View Tab - C:\Windows\System32\rundll32.exe shell32.dll,Options_RunDLL 7 Search Tab - C:\Windows\System32\rundll32.exe ...

6

reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveTimeOut /t REG_SZ /d 600 /f The value 600 is in seconds, = 10minutes Interestingly, as pointed, this works only the first time. On next change, you need to make a new key like so : reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveTimeOutTemp /t REG_SZ /d 300 /f Then delete ...

6

You need to quote when it otherwise would be interpreted differently from what you might intent by the shell. A few examples: You'd quote the string argument foo bar to prevent a program to interpret it as two arguments due to the space. # results in two directories, 'foo' and 'bar'. mkdir foo bar # results in one directory named 'foo bar' mkdir "foo ...

6

A common question in Unix. The main way is to give the full path name to the file, so it doesn't have a dash in front of it: $rm -file.txt unknown option -l$ rm ./-file.txt #No problem! $rm$PWD/-file.txt #Same thing Some commands, you can use a dash by itself (or a double dash) to end the options. However, this is not necessarily true with all ...

6

Run a normal process listing through Terminal: ps auxww The ww options are BSD syntax for a wide listing. You can also use: ps -ef for the now commonly used POSIX syntax. Example output, where you can see the arguments of various processes: USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND werner 22208 3.8 0.1 ...

6

It means the tool should stop treating the dash as an option character. For example, suppose you want to search for a dash character in a file: grep -- - file In your example the -- is necessary because the gem tool is calling another tool, which also uses dash-prefixed options.

Only top voted, non community-wiki answers of a minimum length are eligible