views:

130

answers:

1

Hi All,

Is there any way to link batch script (.bat files) so that they run via another shell/console and not cmd.exe ?

For instance, if one install powershell or others (a few are open-source projects are available on soureceforge), how to link it to your bat files ?

I looked in the "file types" menu but it seems that the bat extensions is not listed !!

Cheers David

+1  A: 

You can probably always set another association in the registry under HKCR. But I don't particularly see the point. PowerShell won't execute batch files anyway; it's a completely different language.

Joey
My batch files do run on powershell on my machine...I agree that it has a different internal language,etc.. so it probably links to cmd.exe to execute the batch file and display its output back to powershell.the point is that cmd.exe is, let's be honest, less than mediocre.. at least with powershell, you can copy/paste things in and out easily
DavidM
@David: Both cmd and PowerShell use exactly the same console windows. Copy/paste functionality isn't provided by the shells but by the console host; that solely depends on your settings there. QuickEdit mode is a nice start for example. And yes, PowerShell simply defers to the normal mechanisms of launching programs or documents. You will notice that it opens Notepad with `.txt` files as well. It simply does the same as if you'd be double-clicking on the file in Explorer. In this regard it's also no different than cmd, by the way.
Joey
@Johannes: well, I didn't find any way of changing the copy/paste settings of cmd.exe.. it's just awkward as one has to select "mark", or similar (which as an option name doesn't mean much) and then the selection doesn't work 'by line' making very hard to select things properly ! let's be honest, cmd.exe is a crap shell
DavidM
@David: I'm repeating myself here: That's *not* cmd what you're seeing there. Copy/paste is handled by the console host process, *not* by the hosted console application. Go to the properties, enable QuickEdit and have fun. It's absolutely no different for PowerShell, except that PowerShell may set its defaults differently for the shortcut.
Joey
@Johannes: yes, thanks. I just tried the quickedit thing; yes it does help a bit but it's still a bit akward for selecting an entire command line that spreads accros multiple lines... anyway we are getting away from the original question here. Thanks
DavidM