Finding unofficial command line switches - windows

How can I go about finding out command line arguments for a given application? I know you can use /? and, if the app supports it, it'll display the switches, but is there a way to find 'unofficial' ones in a program?

Obviously google is the easiest answer... barring that... I don't think there is any special alternative to /? that will give you additional options. You might try running "strings" against the executable in question. That may spit out some hidden options. "strings" comes with most(all?) unix distributions, for windows: http://technet.microsoft.com/en-us/sysinternals/bb897439
If your not familiar with strings... it just spits out every string it can find inside an executable... it's often useful for finding hidden things.

For finding silent install switches, I found Universal Silent Switch Finder 1.5.0.0 to be helpful. Because the original version is very old, I cannot find it on the original website, but softpedia has a download up: http://www.softpedia.com/progDownload/Universal-Silent-Switch-Finder-Download-180984.html

Related

Does Windows return command line switch character?

In Windows, command line options are preceded by /, sometimes by -. Is there a way to query Windows for this character? In MS-DOS, there was a SWITCHAR setting in config.sys. Is there a similar setting or system resource which can be obtained from Windows? Or should my command-line app simply use / or - without looking anywhere?
I don't think there was ever a way that this was exposed externally. Perhaps some DOS 2.0 commands checked it, but nothing else did.
"SWITCHAR was never really supported, even by DOS commands (let alone third-party programs)." [source]
I assume third-party programs were expected to parse config.sys themselves. I don't think there was any Windows support to get this particular value. (A Larry Osterman blog post talks about the history of SWITCHAR and hints that there might have been OS support for it once upon a time.)
Best practice is to allow either.

$(shell [foo]) in Windows

I've got a makefile (a file called 'Makefile' which is run by cmake in Linux, but works in Windows via nmake I believe and needs to be run in VS command prompt.)
And most of the 'sample' ones I can see are just one line (and the rest appear to be stuff I don't 'yet' understand and then this same one line.
include $(shell rospack find mk)/cmake.mk
(in the terminal rospack find [package] returns the path to said package, and cmake.mk is obviously the file it wants to include)
My problem is, that this appears (to me at least) to be written for use in a Linux system (which basically the entirety of ros, the program I'm working with, was) and in Windows this appears to just try to be
include /cmake.mk
(which unsurprisingly doesn't work)
Basically I need to know how to do the same thing in windows, generally in a 'dynamic' way, as it will only cause more problems down the line if I get this working by hard-coding the directory path and then it breaks because its not set properly some time in the future)
So I guess if this isn't possible or is particularly hard, a way of hard coding it would be a stopgap.
I tried:
include C:\[directory]\cmake.mk
but it seems to have issues with the ':'
I'm trying to work with Windows, because later in my project I'll be needing to use another program (for i90 robot) for which we only have Windows support.
OK, so apparently it acts differently if the file is actually in the folder.
as in
include C:\[directory]\cmake.mk
Errors with
C:\[directory]\cmake.mk not found
if the file isn't there, and
fatal error U1034: syntax error : separator missing
if it is
While this doesn't really seem to impact on the original problem, I guess it indicates I'm trying to do something funky windows doesn't like.
The short answer is, you'll never get a single makefile that does much of anything complicated that will work both with standard UNIX-style make (such as GNU make from GNU/Linux) and also work with nmake. Nmake is a completely different beast.
As an aside, it's confusing that your makefiles here are called "cmake", because cmake is an actual program, distinct from make (and nmake). I'm assuming, though, from the context that the use of the term "cmake" here doesn't refer to the actual cmake utility. Which is too bad, because if it did use cmake things would be simpler for you. Maybe.
It's not clear exactly what your requirement to use nmake is, though. If you laid out your real requirements, it would be a lot easier for us to advise you. For example, you say you need to use a "another program" which runs only on Windows. What does this program do, exactly, and how will you need to use it? Does it provide libraries that need to be linked with the "ros" code?
Basically, your simplest way forward is to obtain a UNIX-like environment, including tools like GNU make, for your Windows system. There are two main choices: Cygwin, which provides a completely POSIX infrastructure including shell, compiler, etc. which are ports of the GNU environment to Windows but require a POSIX layer, and MinGW, which has various GNU tools that run more or less natively on Windows.
However, if you MUST use Visual Studio as your compiler, for example, then these will be much more difficult to integrate.

How to find out what .com file do?

I have old executable com file and I need to find out what it do.
What is the simplest way to decompile or diassemble or debug com file?
You can debug your file using the old debug command on Windows XP or lower. A good manual is provided by Kip Irvine here. Additionally, you can disassembly it using NASM with this command, but it is not guaranteed to work.
you may try
executable.com /?
If it was done by a "real" programmer, it would give you some hints.
Also try -?, -h, /h, -help, /help
I have even seen things like --help
probably you did, but to be complete: did you google the filename?
A .com file is basically a .exe file with a size limit, so unless you have the source code (in which case you likely wouldn't need our help), or how it was compiled, it's impossible to do this in modern Windows. Sorry.
By the way, I'm guessing you don't really understand what .com files do, so try this website called https://fileinfo.com. It has information on most file extensions and types, and it can tell you what programs are able to open it. I think you could find it useful

File search application for mac os x with wildcard support

Is there any program available for searching files in Mac OS X with wildcard(GLOB) support? I am looking something similar to SearchEverything in Windows??
quicksilver/spotlight/google quick searchbox/alfred app doesn't solve my problem :(
thanks
You can use mdfind for files that have been indexed by Spotlight. To do wildcards you need use the following format:
mdfind "kMDItemDisplayName=='*back*'c"
You can use this approach as "Raw Queries" in the Finder GUI as well. Example pic below, and see my answer at https://superuser.com/a/491119/66255 for more info.
When you open the finder, instead of searching in the little box, hit Command+F. This will bring up more options to choose from:
There are also more options that are hidden by default. Under the "name/kind" list is the option for "other". This will present you with even more stuff to choose from:
Almost kind of overwhelming at how many hidden options there are, and I believe it changes depending on which programs you have installed. BUT, better than the (GUI) alternative I suppose...
Hop that helps...
use the unix find command!
http://www.athabascau.ca/html/depts/compserv/webunit/HOWTO/find.htm
Besides find, depending on what you are trying to do you might find the OS X mdfind command useful. It's a command line interface to the metadata-store used by Spotlight.

How do I deliver (distribute) a Perl application?

I wrote a program in Perl, and now I want to send it to buddy. I don't want him having any kind of bother with launching it.
How do I make some package which he can just click and have all things ready to launch?
PS. I can ask him to download ActivePerl and install it beforehand.
PPS. I don't need to hide .pl sources from him. I need though automatic download and install of all required CPAN modules.
Also, what if in future I will need to scale it for production delivery? Meaning, it will be not a buddy on the receiving side, but Mr. Client?
I have used pp with great success. It can package a Perl interpreter and used modules all together into an executable file.
Then again there is always B::C which provides a perlcc utility, but I haven't had as much luck with that.
For easy distribution to windows clients, its hard to beat PerlApp, Par::Packer (aka pp), or Cava Packager.
Although I like Joel's suggestion best I'd want to point out another solution for you. As it seems you're targeting Windows you could also use the portable version of Strawberry Perl. Install the modules you need, add your script/application to it, setup a simple batch script to launch it with the portable environment and you're set.
The biggest downside compared to the pp (PAR::Packer) solution is that the size of your application will be rather big as pp only includes that what is necessary.
You might be looking for IndigoStar's perl2exe:
Perl2Exe is a command line program for converting Perl scripts to executable files. This allows you to create stand alone programs in Perl that do not require the Perl interpreter. You can ship the executable files without having to ship your Perl source code. Perl2Exe can generate executables for Windows and Unix target hosts.
Of course, the easiest way would be if your clients could run perl.
Yoy may wish to try Cava Packager. It can produce executables from Perl code on Windows, Linux and Mac OS X. It takes an alternative approach to PerlApp, pp and perl2exe. You should probably try them all and decide which you like best.
Note: As indicated by my name, I am affiliated with Cava Packager.
Par::Packer will do the job for you, without any fuss and is completely free. As long as you have installed the correct dependencies, you simply (on a windows machine) open a command prompt, CD into the directory where your perl source (e.g. 'samplefile.pl') resides and type: pp -o sampleprogram.exe samplefile.pl. After a minute or so, 'samplefile.exe' is compiled, and you can send it to your friend to run
Perl2Exe is a proprietary solution, and although it is good, is not free
Good luck!

Resources