Shell Extension in the Command Prompt - windows

I have a shell extension installed into the filesystem by adding ".{CLSID}" to the folder name. The Shell Extension is like the .zip extension (allowing you to see files). Explorer handles it fine, but how do I get other program to recognize the sub files/folder (programs like command shell). I navigate to the directory with the shell and it shows the empty folder (also, it doesnt strip away the clsid). Is there some way to implement that functionality? Do I have to install the extension in a different way?
Thanks!
chacham15

If I remember correctly, there is no documented way to add an extension to the windows cli shell (cmd.exe).
There is an add on shell for windows called 4NT that is extensible.
That said, you'll still end up writing scripts if I understand your question correctly.

Related

Files with "sh" extension on windows

Our Apache web server works in a Linux environment.
The cgi executables are called via a sh file (for example /cgi-bin/iwsblogin.sh).
The call "/cgi-bin/iwsblogin.sh" is in an html file.
Now I want to make a development and testing environment for this web server on windows.
I do not want to change the calls in the html files from "iwsblogin.sh" to "iwsblogin.bat" just for testing purposes.
Is there a way to configure windows in such a way, that files with the extension ".sh" are treated as executables the same way as ".bat" and ".exe" files?
The contents of this .sh file is for example:
- ms dos commands for setting some environment variables.
- Path of an exe file which should be called.
I know that there exist similar questions on stackoverflow where user suggest using cygwin, but this is NOT an option for me!
Thanks alot in advance
There are some ways to do this.
If the .sh file works when you rename it to .bat, you can use "run as" and select C:\Windows\System32\cmd.exe as default program
Use a sh emulator. For example, msysgit includes one or you can use cygwin (possibly the same source?).
I know you don't want to use cygwin, but why not? Please explain why this isn't an option. It is hard to look for an answer if we don't know why regular answers won't work.

How to create and execute a file full of commands on Windows command prompt?

Example:
In Linux we can put the desired commands in a file and give it executable permissions. This helps us to actually run the file on the terminal and thus all the commands inside the file get automatically executed.
How to achieve this on Windows XP?
Same thing, but it's called a batch file, extension is .bat. You can also double-click to run these. This site is a great resource.

When to use .exe and when not?

I dont really understand whats going on and cant see the difference:
I'm downloaded the base64.exe for creating base64 text under windows. i copied it to C:\Windows\ because its in the %PATH% variable.
Now i want to try it: echo Hello | base64 works great. Okay i dont need to append .exe and as far as i know i dont need to do it also with .bat and .com files.
But now i have some cygwin tools installed and for example tried which base64, which doesnt work, because it says that base64 is not in path. Then i typed in which base64.exe and got C:\Windows.
So my question is now: when i need to use .exe and when i dont? Is it only when i'm using cygwin tools that i need to append .exe?
Cygwin is a shell which emulates UNIX behaviour. UNIX doesn't know anything about .exe, thats why Cygwin can't find base64.exe. Under UNIX, binaries are stored without an extionsion added to their filename, e.g. just base64.
Windows CMD automatically appends .bat, .com, .exe and the like to your file names. Cygwin does not. So if you are using a linux shell you have to append it manually.
Since Cygwin is aware that it always runs under Windows it might append .exe if you want to perform certain actions in the shell itself (e.g. opening a file), to behave more friendyl to Windows users who expect this behaviour. However programs running under Cygwin might not integrate those features since they were mainly devoloped for usage under UNIX. That could be a reason why which base64 fails.

Any way to interpret a command without running cmd.exe?

I am looking for a way to run an executable or a script without getting cmd.exe to do it for me. Currently I'm launching a process using cmd.exe /C <command>, which I need to do the following things for me:
Look for the executable file in the current directory and PATH
Interpret PATHEXT to permit extension-less script commands
Interpret file associations to, e.g., run the python interpreter when I tell it to run blah.py.
I don't need to be able to run any of the "built-in" commands, like "dir".
Is it possible to avoid using cmd.exe without essentially re-implementing all of the above functionality? There must be some sort of shell API to do the above things, right?
ShellExecute should do exactly what you want - you can use it to launch an executable or a file (which is then opened with the standard application),
http://msdn.microsoft.com/en-us/library/bb762153%28v=vs.85%29.aspx
Take a look at System.Diagnostics.Process.Start( appName, args) .
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx and about the shell, have you looked it: http://msdn.microsoft.com/en-us/library/bb773177(v=vs.85).aspx ?

attempting to assign alias to path of an exe file in dos shell

I want to set an alias to my installation of firefox so I can easily start a web page, the problem is that I dont want the script to be system dependent.
Namely I want it to be able to run on a linux distribution where the command to start firefox is already mapped to 'firefox' and can easily be run that way through bash, but on my windows machine I cant seem to get it to assign to the same variable.
I saw that I could set it to '%firefox%' via the set command but that's not quite what I want.
I believe creating aliases is possible on a windows environment because the version of svn that I use auto-installed and was able to assign itself to 'svn'. Anyone know what was involved in them being able to get their alias working, or a similar way to alias a command?
If you include your Firefox path in the %PATH% environment variable, you can start FF with "firefox". Under Windows, you should edit the system-wide settings (see this link).
AFAIK, there is nothing similar to aliases under DOS/Windows (except the %firefox% way you mentioned, too). The 'svn' command you talked about most likely is the same thing, a 'svn.exe' and its path included to %PATH%.
This is a bit restrictive, as you can only use the original filename to launch a program, but you can work around this by creating a batch file in the program's path that launches the program, f.e. a FF.BAT that contains "firefox %1".
Alternatively, you can place a batch file in a path that already is in %PATH%, f.e. the Windows directory. That way, you don't have to modify %PATH%.

Resources