CMD.exe replacement [closed] - command-line

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Does anyone know of a good Command Prompt replacement? I've tried bash/Cygwin, but that does not really meet my needs at work because it's too heavy. I'd like a function-for-function identical wrapper on cmd.exe, but with highlighting, intellisense, and (critically) a tabbed interface. Powershell is okay, but the interface is still lacking.

Edited: I've been using ConEmu (http://conemu.github.io/) for quite some time now. This one is a wrapper too, since it is not really possible to replace the Windows console without rewriting the whole command interpreter. Below the line is my original answer for an earlier alternative.
Not exactly a replacement (actually, it's a prettifying wrapper) but you might try Console (http://sourceforge.net/projects/console/)

I've been using JPSoft's products a long time (starting back with 4OS2 and 4DOS), and currently use Take Command 9. It works with existing batch files, has it's own improvements on top, a tabbed interface, and filename coloring options.
Looks like their site is having some problems right now, but you can find them at: http://jpsoft.com/

I use Take Command 9.0. I have used JPSoft's products for years. It has a tabbed interface. I have Take Command start with Take Command, Powershell, and CMD.exe each in their own tab. It doesn't do syntax highlighting. Take Command is syntactically compatible with CMD.exe and enhances each command quite a bit and adds many more.
PowerShell isn't a complete replacement for CMD.exe or Take Command. I find myself using both. You might ask why I would still use CMD.exe and it is because I will use Take Command to test a batch file that is limited to commands that work in CMD.exe and I then need to deploy the batch file on a workstation/server that doesn't have Take Command on it. I can create/test in Take Command and then verify it works in CMD.exe before deploying it.
I don't know of any IDE's that provide Intellisense for batch files specifically. If they did it would only be for a few keywords anyway. Most of the time in batch files you are running commands that are external to the batch language and wouldn't be included in the Intellisense.
I use Textpad to edit my batch files. Take Command has a debugger and it has logging capabilities which makes it very easy to test your batch files.

PowerCmd is a trial-ware wrapper for cmd.exe and costs 30$
It offers:
tabs
a "normal" selection mode
copy'n'paste
highlighting
auto complete
buttons to start Python, Powershell and others

If you want a more feature-rich UI for Powershell, try PowerGUI.
http://powergui.org/index.jspa

NYAOS
"NYAOS" is the tcsh-like enhanced commandline shell for Windows and OS/2 !
http://www.nyaos.org/

For decent completion and command history, try the PyCmd wrapper at https://sourceforge.net/projects/pycmd/

I use 4NT from the above mentioned JPSoft. It works great and has great added functionality. It is being replaced by TakeCommand but I do not need that much extra functionality.
Update:
It's no longer known as 4NT. Now its name is TCC/LE.

Nick, I know you asked this a long while ago but I've just found it while searching for something related. I have been using PromptPal and its been great. I got it about a year ago, early 2008, and it was through this discount software thing called BitsDujour. I just went there and noticed they had a deal for 51% off that product only a few days ago. Keep your eyes on that site and maybe the discount will come up again soon. Its well worth the $30 but I got 2 licenses for 1/2 off, one for each of my PCs...

If you want not to use cmd.exe totally then go for ZOC.exe terminal.ZOC is enterprise application.
Else just add some feature to your Command prompt by installing GOW.EXE.GOW is opensource application.
But always you can go for Git which is giving mostly commands in bash. Just add the bin folder to your environment path. Your command prompt will work as unix terminal.

Related

Obfuscating a PowerShell script

I have written a PowerShell script in many hours and days and would like to obfuscate it, but so that the code is no longer readable or decompilable, but the script can still be executed. Is there something like that?
With regards to actually obfuscating an entire powershell script, this site seems to do just that.
I tested a script a little over a year ago and here are some of my findings:
Windows10: The obfuscated script worked on Windows 10. I dont
remember the Powershell version I had back then.
macOS: Confirmed it also works on Macs (if you have powershell installed), but I remember there were some errors spat out.
I just tested another script a few minutes ago on a Windows Server 2016 (PSVersion:5.1./Desktop) system. No issues so far.
Now, as was already mentioned by previous posters, it is important to note that any obfuscation can be hacked into. It's just a matter of incentive for the hacker.
I say "any" specifically because you dont control the hosts on which your powershell script will be used. And as such, those who do, if inclined, can alter the binary of the powershell program to get it to spit out everything that it does. How easy that is, I do not know. But a quick google search suggests there are settings available that, if turned on, can log the entire execution of your powershell script, obfuscated or not.
A couple of links that touches on Powershell logging:
PowerShell Logging: Recording and Auditing all Things
About Logging Windows - PowerShell - Microsoft Docs
There is a thing named Powershell Constrained language.
Quoting from here: https://devblogs.microsoft.com/powershell/powershell-constrained-language-mode/
Constrained language mode is a language mode of PowerShell designed to support day-to-day administrative tasks, yet restrict access to sensitive language elements that can be used to invoke arbitrary Windows APIs.
In Constrained mode, these are not supported:
COM objects
Unapproved .NET types
XAML based workflows
PowerShell classes
It's best for running administrative tasks, still it's not better for daily uses. To start it use:
$ExecutionContext.SessionState.LanguageMode = 'ConstrainedLanguage'
Read more here: https://devblogs.microsoft.com/powershell/powershell-constrained-language-mode/
The Invoke-Obsufcation wrote by Daniel Bohmann is much better for this purpose. Link: https://github.com/danielbohannon/Invoke-Obfuscation
Usage Guide: https://blog.vonhewitt.com/2017/08/obfuscating-powershell-commands-using/
If you want something to obfuscate your powershell code to make it unreadable but keep it working you should check a project called Invoke-Obfuscationation done by Daniel Bohannan. You should check his talk about powershell obfuscation where he presented the tool.

PowerShell to executable - go the extra mile or leave it?

It seems like it is not all that easy to create an executable from a PowerShell script - do you know if it was ever meant to be an option?
I have found tools like PS2EXE, but still it does not seem like it was meant to be.
I am asking, if it is worth it to go the extra mile or leave it.
Background reason: I have some less technical users that need a smoother workflow.
As #Bill_Stewart kindly noted:
PowerShell is a shell that contains a powerful scripting language.
Which is perfectly in line with Microsoft's definition :
PowerShell is a task-based command-line shell and scripting language built on .NET.
Basically, wrapping it in an executable would go beyond its purpose. The nice thing about scripting is, that it's lightweight and task based. And in this case, that you can easily run it on multiple OS-ses.
So, I wouldn't go through the effort creating an exe.
If you want to run it easily, just create a .bat or .cmd file (if using Windows). On windows, I believe, you can also create a shortcut with command arguments and a little icon.
For Linux you clould use a .sh.

How do I make an executable to avoid command prompt on Windows? [duplicate]

This question already has answers here:
How do I make my Perl scripts act like normal programs on Windows?
(5 answers)
Closed 9 years ago.
The reason I'm asking this is because after half an hour of failing to figure out what key word or jargon to use I figured it wouldn't hurt to ask here.
What I'm currently doing is getting a perl code to run using the good ol:
perl myPerlScript.pl
To get it to run. What I'd like to do for simplicity of presentation as a prototype would be to figure out how to make a script that I can run as an executable that would effectively be just a replacement of that. I know on Linux/Unix you can make bash scripts, but I'm trying to run this like I would Steam or other executables. Any advice or am I asking for something impossible? Having the command prompt pop up in the background is an option but preferably avoidable.
Also I've been using Cava Packager, but it's so bulky I figured since I'm only using one script there would be an easier way.
This answer shows how to make it so you can simply do
myPerlScript.pl
or even simply
myPerlScript
(Another way of achieving the latter is with the pl2bat tool.)

Are there any console (not GUI!) alternatives to powershell.exe?

There are a number of GUI hosts for Powershell (Powershell ISE, PoshConsole, etc) but I'm not aware of any purely console hosts other than powershell.exe. Are there any that offer any advantages over powershell.exe?
I'd like to be able to customise more of the host behaviour - specifically to add and customise key bindings other than TAB, and to customise error reporting. There could well be more...
If there aren't any "extended" versions of powershell.exe that offer this, how difficult would it be to write one? I have the SDK sample code, and it looks fairly accessible, but it's hard to be sure what features powershell.exe provides as opposed to the powershell "engine" (as there's no documentation I've found that focuses specifically on the host capabilities).
How about Console it can host multiple shells. Might be worth a look.
The best pure-console for PowerShell is obviously PowerShell Plus, which actually uses a fullblown "native" Windows console, but it wraps it up in candy coating and adds tons of IDE-style features. As far as I know this is the only third-party host that's capable of running "graphical" console apps like edit.com
As a sidenote, I'm honestly not sure it's worth the handicap of a true console just to keep compatibility with whatever graphical interactive console applications like Edit.com might still be around. Considering the limitations, and the amount of work that has to be done to pull off something like what PowerShell Plus has... Personally I can't wait for the day when I no longer have to worry about and can move on to console apps that are really MEF-style plugins in a console-style interface like PoshConsole :-)
I realise that this question is years old, but since I stumbled across it in search of answers, I thought I would add my findings.
I settled on Cmder, for the following reasons:
It wraps cmd and Powershell, so you get the same set of features you would find in either.
The default colour scheme is Monokai, which is not only pleasing to the eye, but actually readable. Maybe I was missing something, but the default output for most of my tasks (Git, Mocha tests etc.) had poor contrast most of the time and I found myself squinting at the screen.
Tab support - I've wanted this for a while, but until now I hadn't found a solution that provided tabs as well as everything else. Powershell IDE has some character encoding / text colour issues that I couldn't ignore.
It's portable - stick it on a USB stick and take it with you wherever you go.
It's configurable - the developer (Samuel Vasko) has done a great job here. It's not lacking for customisation.
Specifically answering the OP's requirements, you can remap key bindings and create macros. I don't see the ability to customise error reporting however.
Hopefully anyone else out there still searching for a decent command line emulator on Windows will see this answer and rejoice.
If you stick with a "Console" subsystem approach you will be saddled with all the limitations that come along with a Windows console subsystem application. Many complaints about PowerShell.exe limitations are really limitations of this feature of Windows (kbd shortcuts, line editing, etc).
What's wrong with PoshConsole? Even though it allows graphics to be displayed it is still a "console-style" UI on top of the PowerShell engine?

What is the native way to create a shortcut (.LNK file) from the Windows XP command line? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
EDIT!
Sorry to change the question on everyone, but I am really just asking:
How do I create a shortcut (.LNK) file from the command line with as little outside help as possible? I really don't want to run a VBscript or to download a program to do it for me. Is it really that hard?
Thanks to everyone who provided exceptional answers when I didn't really know what I was asking yet!
The original title of this question was:
Windows equivalent of Unix ln -s for
creating shortcuts from the command
line?
The original question text of this question was:
On *nix, I can create a symbolic link
to a file very easily from the command
line using ln -s.
How do I natively create a
shortcut to a file using the Windows
XP command prompt?
Note: This is not the
approach I want to take. I want to do
it the way Windows does it. I want to
do it the right way.
Windows XP and later has the fsutil command, which can create "hardlinks" to files.
See:
MSDN: Hard Links and Junctions
JSI Tip 10153: The Windows XP FSUTIL.EXE HARDLINK CREATE command
XP doesn't have symlinks. On Vista, the command is mklink. Shortcuts are not symlinks.
This is not a native Windows call, but you should probably look into Windows Sysinternals' Junction. This is a very handy tool of good quality.
If you don't want to rely on external software, you should look at kb205524 for native ways of creating junction points.
http://www.ss64.com/nt/shortcut.html
EDIT:
Sorry I deleted that. .. but that is an old NT command ... don't know if it active on XP.
I have a file called shortcut.exe on my system. Honestly, I have no idea where I got it. :-( But a quick search came up with the following website:
http://www.optimumx.com/download/#Shortcut
Maybe that will work for you?
mklink link target
Unfortunately, this only works on Vista/Server 2008 or newer.
Actually NTFS does support symbolic links. See Wikipedia NTFS_symbolic_link
Softlinks are supported by the file system used by windows.
Though this functionality is not exposed by any standard windows tools.
There are opensource tools available that can do the trick though.
Everyone seems to be beating around this bush, but I haven't seen anyone actually come out and say it yet: NTFS supports something called "junction points", which are very similar, though slightly less useful than, symlinks. These are different than both shortcuts and hard links. I use them regularly for building different versions of our software at the same location on my system (just repoint the build directory link to a different SVN checkout). The tool I use for this is called ntfslink. That page also contains a pretty good explanation of how NTFS junction points work and which versions of Windows support which features. I use it on Win Server 2k3. The ntfslink program is a shell extension, but there are other similar utilities that work from the command line. There are also Windows API functions available to create them if you want to do it programmatically from whatever app you're developing.
I don't know if this EXACTLY answers the question, but it sure makes life easier!
Go to where the program's installed. Create a shortcut to the .EXE or startup file. Put the shortcut on the desktop so you know where it is! Then drag the shortcut to the START button (in XP). When the START menu appears, drop it ABOVE the little line (so it stays visible). Hey presto - an instantly created .LNK file with Windows doing all the work for you (yes this DOES work, I've just this second done it/worked it out when I read the question here.)