I'm using Windows7, and I installed Ruby on Rails with RailsInstaller. This comes with "Command Prompt with Ruby and Rails", which I think is just a regular cmd prompt that automatically starts Rails...
Anyway, the problem I'm having is that I cannot change the buffer size. I have changed the buffer size to 999 in the Options tab of the Properties, but to no avail.
I've done the same thing to the regular command prompt that comes with Windows and it worked.
So I solved my problem. I could get the buffer size working correctly in the regular Windows command prompt, so I just made another shortcut to that, and then in the Properties->Shortcut tab I changed Target to C:\Windows\System32\cmd.exe /E:ON /K C:\RailsInstaller\Ruby1.9.2\setup_environment.bat C:\RailsInstaller
Still not sure why changing Options on the cmd prompt that came with railsinstaller didn't work though...
Related
Dopusrt.exe /acmd Go "c:/"
The above command works, last active Window goes to c:/ but the below command does not work.
Dopusrt.exe /info documents\filelist1.txt,listsel,0
The weird thing is it works just fine in Windows Terminal. Does CMD reserve commas for something? I really need to use CMD in this case, Since Auotohotkey seems to only speak to CMD.
Thank you.
CMD and Windows Terminal are not the same type of application. CMD is a shell, and WT is a terminal. See this post for more details.
You can run any shell you'd like in WT - CMD, PowerShell, whatever.
CMD.exe does not by itself reserve commas (to the best of my knowledge). And running cmd.exe in WT vs running it in conhost (the default console on Windows) shouldn't make a difference either.
When I start cmd.exe from start menu, I get the registered (in registry) PATH variable, in a new window.
I want to have exactly the same effect from my cygwin+mintty, and try the followings:
Firstly I try:
bash$ cmd
This gives me a cmd shell, right inside mintty. But I want it to be in a fresh new window. emm... Perhaps I can try:
bash$ cmd /c start cmd
It nicely gives me a cmd shell in a new window. Good. However, the PATH inside that command shell is not the same as a fresh new one.
C:\>path
PATH=C:\cygwin64\usr\local\bin;C:\cygwin64\bin;C:\ProgramData\Oracle\Java\javapa
th;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\W
indowsPowerShell\v1.0;C:\opencv\myrelease\bin;C:\Qt\5.3\mingw482_32\bin;C:\Progr
am Files (x86)\Skype\Phone;C:\Program Files (x86)\Windows Kits\8.1\Windows Perfo
rmance Toolkit;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\cygwin64\
lib\lapack;D:\home\robin_hsu\bin
C:\>
You can see those paths with cygwin64 are not wanted. So, what can I do to get a new fresh cmd window, with correct PATH?
Note: I believe the problem is due to PATH is inheritable, from bash to cmd.
Perhaps someone can give me some hint to get the registered PATH of windows system under cygwin's bash. If that is possible, I can first change the PATH to the desired one, and then call cmd
So, this is basically a duplicate question to Start new cmd.exe and NOT inherit environment?. However, that question doesn't ask to open a new window, and at least for me the answers there didn't give me a correct path. The following command gives both (for me, on XP).
cygstart "$WINDIR\explorer.exe" "$WINDIR\system32\cmd.exe"
The only issue is that it also brings up dialog boxes 'File Download - Security Warning' AND 'Windows Explorer - Security Warning'. This link shows how you can avoid this in general, but I'm not sure if it's possible to remove the warnings for just one specific file. There are also a couple of answers here and here on superuser.com about disabling the warnings.
Hope this helps.
I was wondering how you would get Ansicon working on Console2. Currently, tere is color when I run cmd.exe and colors show up (ie. Rspec).
BUT, i have tried to use Console2 (Settings, Tabs, Shell -> C:\Windows\System32\cmd.exe "C:/Ansicon/ansicon.exe", C:\Windows\System32\cmd.exe ansicon, etc... ) it just doesn't quite work. I have also tried variations such as "C:/Ansicon/ansicon.exe", but it shrinks up the Console2 window.
Now here's the kicker..... after I open a tab in Console2 and verify there isnt color, by running Rspec, I run "ansicon" again and execute the same command, and there would be color...
This might be a really simple question, but hopefully someone can point me in the right direction.
Thanks a lot in advance!
Your starting command must be
C:\Windows\system32\cmd.exe /k Ansicon -p
Also, why not to try ConEmu? It can ANSI internally.
How do i launch firefox from perl? i just need to launch the browser so WWW::Mechanize::Firefox can manipulate it. Searching around stackoverflow ive seen a few solutionsl like system('start cmd.exe /k $cmd) where $cmd is arguments to throw as input once cmd is started.
However, these have not helped me to solve my problem at all.
solutions ive tried
system("start cmd.exe /k start firefox");
system("firefox");
system("cmd","start","firefox");
system("cmd start firefox");
Basically a lot of the alternatives ive found, but i could not launch Firefox browser at all.
You're on the right track. Your second line is almost correct. If firefox is not in your PATH environment variable, you need to supply the complete path.
Click on the Firefox icon on your desktop, open the properties and check where the firefox executable is located. Then use that with your system call.
For me, it looks like this (the ' are for Perl's string, the " are for the Windows shell, because the path has spaces in it):
system('"C:\Programme\Mozilla Firefox\firefox.exe"');
You can test it by opening a new command line (win + r, cmd), cding to the directory where your Perl program is run from, and just entering the command:
C:\Dokumente und Einstellungen\simbabque>"C:\Programme\Mozilla Firefox\firefox.exe"
It will not print anything, but just open a new Firefox window after a couple of seconds. So you'd probably need to hold your program execution in Perl while the browser is starting up.
WWW::Mechanize::Firefox will launch firefox for you but you can use
system 1, qq{$ENV{PROGRAMFILES}\\Mozilla Firefox\\firefox.exe}
When I type 'http://www.google.com at the Windows Run: prompt it launches my default browser.
But when I do it at the CMD or Commnad prompt it does not. I assume that there is some form of RunDLL command being issued but I can't find out what.
Does anyone have any insight?
I think it's the equivalent of using START.
If you try
START http://www.google.com
from the command line (or a batch file), it should work fine.
What Jon said appears to be correct. I tested it with mailto:someone#somewhere.com. Interestingly if you wish to make run work like the default behaviour of cmd, you can do the following:
Start -> Run -> cmd /c http://www.google.com. Not sure why anyone would ever need to do that though!