.bat Set FontSize - Windows Command Line - command-line-arguments

Intro:
I swear have searched around for sometime before posting, but have been unable to find an answer for this..
Question:
Regarding Windows Command Line:
is there some way to set the font/text-size via an actual windows command line in a .bat file?
-Not through going to Properties -> etc. (I understand that quite sufficiently :P)
--Plz no PowerShell.
Additional Notes:
Reason: Thinking of business system based Command Line front-end, PHP back-end.
Thanks in advance.

Without using PowerShell, the only way I can think of would be to modify the registry values under HKCU\Console. See the relevant Technet documentation. However, changes made to the registry values will not update already running console windows. You won't see your changes until you spawn a new console.
As far as how to make changes to the registry, reg /help for more info.

Related

Editing Default Commands on Windows Command Prompt

I am creating a Windows virtual machine and would like to edit the default commands for the command prompt like tree so that when that command is typed it will do what I want it to do. I found 'tree.com' in System32, but when I open it, it is gibberish. How might I be able to read and edit it?
Modifying basic Windows programs is not a good idea (in case you need them there not there anymore), but there's another approaches: doskey, based on UNIX aliases: this allows you to, when you enter tree, to start up another program instead. Help can be found under doskey /? and there are plenty of examples online.
Files with extension .com are compiled executables. There is nothing to edit in there.

Windows App Store execute simply cmd command

I need execute simply command in cmd.exe, for example:
ls -l
I care to read the result of executing this command, but I know I didn't Process library. Could you help me?
You can use so called "brokered components" to achieve this. This worked for Windows 8.1, I'm not 100% sure but think it still works for W10.
It's a little hacky. The reason is that it requires extra steps to get along with the security restrictions in Windows and therefore you need some additional projects and stuff
Here's a link to a blogpost on this:https://blogs.msdn.microsoft.com/mim/2014/06/24/create-a-winrt-brokered-component-feedback-from-a-real-life-developement/ You will find more details if you search for "brokered components".
You can see it in action in a video I recorded for YouTube some month ago: https://www.youtube.com/watch?v=3yiZBG6PQmY

How to change the system locale on Windows 7

On windows 7, I would like to change the system locale from the command line without restarting. Is there any windows command line utility or the one in cygwin that I can use?
Thanks
The following link has information of how to change system locale kind of information from the command-line using the intlcfg.exe command.
An example command for you could be as follows, which would change syslocale to US-english en-US.
intlcfg.exe –syslocale:en-US
NOTE: You may still need to reboot for the settings to take effect, have not tried this so unsure about this part.
Doing a quick Google search turned up a lot of results with different ways to do it.
This TechNet article details how to use the Intlcfg command to change settings such as the Locale
Update language and locale settings
intlcfg.exe [-all:language_name] [-uilang:language_name] [uilangfallback:language_name] [-syslocale:language_name][-userlocale:language_name] [-inputlocale:default_keyboard_description; keyboard_description or locale_name] [-userhive:registry_path] [-syshive:registry_path] [-swhive:registry_path] [-image:path] [-dist:path] [-silent] [-skudefaults:language]
This article on AutoIt.com talks about setting up XML files and creating a script to switch between them.
It's hard to quote, but the gist is:
Create a text file with the settings
Use rundll32 to apply the changes to the registry

Perl on Windows, file associations and I/O redirection

Can someone explain the difference between calling a perl script via file association versus calling the same script explicitly via perl.exe?
Apparently I/O redirection doesn't work very well when the script is called via file association, and I would really like to know why.
E.g. take a look at the Activestate FAQ for Perl on Windows. The cat file example works perfectly as long as the script doesn't receive its input via redirection. So
cat file.txt
works as expected, but
whoami | cat.pl
does not. Not only is the .pl extension needed, but apparently the output of whoami isn't piped into the script. The script is run (which can be verified by modifying the example cat.pl script), but for some reason it doesn't receive the output of whoami as input.
However, if I call the script like this:
whoami | perl cat.pl
everything works as expected.
So apparently there is an important difference between running the script via file association and explicitly calling perl.exe with the script.
The FAQ mentions the problem and points out that using pl2bat to generate a bat file cover for the script fixes the problem, but I don't understand why this is necessary.
Please enlighten me.
It looks like it was a known bug in Windows 2000: STDIN/STDOUT Redirection May Not Work If Started from a File Association.
I get the same behaviour you describe with Strawberry Perl on WinXP, however once I created the registry entry described in the above article (even though the reg entry is targetted at Win2K), stdin works as expected.
For completeness, in case the link above goes away, the reg entry it suggests creating is:
Start Registry Editor.
Locate and then click the following key in the registry:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
On the Edit menu, click Add Value, and then add the following registry value:
Value name: InheritConsoleHandles
Data type: REG_DWORD
Radix: Decimal
Value data: 1
Quit Registry Editor.
Edit: I ought to add that even though the KB article claims it was fixed in XP SP1, I've got XP SP3 installed. So whether MS have broken this, or never fixed it completely, I can't say!
I know this is an old thread, but it's important to note that Microsoft appears to have reversed the polarity of this setting in Windows 10. No idea why they would do that, but this had me pulling my hair out for a day. See my other posted question (Perl Scripts on Windows 10 run from Explorer but not Command Prompt), and especially the linked MSDN post there.

windows: command line used to launch a program

How can I find out the command line options a program was launched with under windows?
try: http://www.bleepingcomputer.com/tutorials/tutorial132.html
in short:
use the Process Explorer utility created by Sysinternals (now owned by Microsoft; which is probably why vista and windows 7 now have a similar functionality already present in task manager)
On vista... You can
go to the task manager
Click View --> Select Columns
Add the command line column.
To do this programatically, run "tasklist -v" to a file and then split up the file.
If you are trying to get the command line of another process programmatically you should probably read Why is there no supported way to get the command line of another process?:
Commenter Francisco Moraes wonders
whether there is a supported way of
getting the command line of another
process. Although there are
certainly unsupported ways of doing
it or ways that work with the
assistance of a debugger, there's
nothing that is supported for
programmatic access to another
process's command line, at least
nothing provided by the kernel. (The
WMI folks have come up with
Win32_Process.CommandLine. I have
no idea how they get that. You'll have
to ask them yourself.)
If you are trying to retrieve the command line of your own process you can use GetCommandLine.
Try running the .exe but with the /? flag.

Resources