command-line-arguments

Is it possible to have the name of the executable without the path?

Hi I'm trying to use the name of the executable and an usage string, I'm using argv[0] for such purpose but instead of the name of the executable itself it gives me the complete path to it. Is there any way to get only the executable name? ...

How to use _spawn or _exec for bootstrapping?

After writing the following program, it does not appear to pass arguments to the called application. While researching _spawnv and what it can do, _execvp was found as what appeared to be a suitable alternative. Does anyone see the problem in the source code and know what needs to be done to fix it? #include <stdio.h> #include <stdlib.h...

Pass Commandline param to a another file used in execution.

I have a file runContractExports.xml which is as below I set two parameters region and Env beforing executing this file. Now I have a commandfile where i am using the above file for execution The content of the command file is @echo off set PWDDIR=%~dp0 cd %PWDDIR% call eniron.bat set CLA...

Lua equivalent to shlex?

Is there a Lua equivalent for python's shlex library? ...

viewing c# console app arguments

Hi, I have a console app (written in c#) that is passed various arguments from the command line by an external application (an InstallShield exe). Without adding code into the console app or InstallShield exe to log the value of arguments is there any way to see the value of the arguments passed to the console app? (perhaps via some so...

How to convert a string pointer to a 64bit ( _int64) variable??

As I wrote an app with the function main(int argc, char * argv[]) When i start up the application, I wanna send some parameters like (assume the app name is ffdisk) >ffdisk -f 111123123131321312312123 1 You see the third param maybe an int64 param in my original intention... But in function main, argv[2] is string pointer, so how can...

How to pass the assembly name as a command-line argument when debugging

I have an NUnit test assembly (a .NET DLL). When I click Run in Visual Studio I want it to launch NUnit and run the tests in this assembly. I can do all of that. Instead of specifying the full assembly name and path in the command line arguments, does Visual Studio support some sort of macro that expands into that for the Command Line...

find and replace in multiple files on command line

How do i find and replace a string on command line in multiple files on unix? ...

Most efficient way to process arguments from the command-line in prefix notation

Hello, our homework is to write a ruby script who calculate a subset of wordlist depending on the expression. regular binary operations are && And operator || Or operator ++ Concatenate operator ! Negation operator A valid call would be like ./eval.rb wordlist && a c or ./eval.rb wordlist && || a b c First call means generate a n...

How do you determine full paths from filename command line arguments in a c++ program?

I am writing a program in c++ that accepts a filename as an argument on the command line: >> ./myprogram ../path/to/file.txt I know I can simply open an fstream using argv[1], but the program needs more information about the exact location (ie. full pathname) of the file. I thought about appending argv[1] to getcwd(), however obvious...

Passing command-line arguments on clickonce deployment

Im using visual studio 2005 with C# to develop an application that can either perform certain actions by itself or open a form were the user can choose what to do. In order to decide which is done, the application checks its arguments [from main(string[] args)]. What I can't figure out or find is, is it posible to create two icons when...

where command line arguments are stored ?

I have a doubt @ the storage of command line arguments. myprog.exe -cfgfile myconfig.cfg commandline args are passed when process gets created so are they strored outside the process? where OS stores it? ...

Pass arguments when using the File protocol

I found this question being asked on several places on the internet (including the File protocol MSDN page) but no clear answer. So, if I am calling my application like this: file://c:\myapp.exe is there any way to pass it some command line arguments, like /nospashscreen=true Things I've tried: file://c:\myapp.exe?/nospashscreen=tru...

When running a python script in IDLE, is there a way to pass in command line arguments (args)?

I'm testing some python code that parses command line input. Is there a way to pass this input in through IDLE? Currently I'm saving in the IDLE editor and running from a command prompt. I'm running Windows. ...

Set up default option handler for ruby's OptionParser

I'm trying to get simple option handling in my ruby app. Looks like OptionParser does most of what I want, though I can't figure out a way to gracefully handle unexpected arguments. If any unexpected arguments are provided I want to treat it as if the -h argument was passed (show usage and quit). I'm not seeing any way to handle that ...

Getting Short-Filename of Command-Line Argument from Batch-File

Hi, The following command in a batch file does not work as expected/hoped:     echo %~nxs1 Here is a sample display of what I’m trying to get: C:\>type test.bat @dir /b %1 @echo %~nxs1 C:\>test "C:\Documents and Settings\All Users\ntuser.dat" ntuser.dat NTUSER.DAT C:\>test "C:\Documents and Settings\All Users\ntuser.data" ntuser.d...

Parameters with and without arguments in boost::program_options

I wrote a small app that uses boost::program_options for command-line parsing. I'd like to have some options that set a value if the argument is present, and alternately prints the current value if the parameter is given but no argument is present. So "set-mode" would look like: dc-ctl --brightness 15 and "get mode" would be: dc-ctl ...

Alternative for Environment.GetCommandLineArgs()

Just wondering if there is another way to handle this as the arguments are getting split when passing in like this: System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(fileName); psi.Arguments = @"c:\dir1\dir2\dir3\file1.txt"; System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo = ps...

Tracing the arguments of an external .EXE called within a VB.net app

A program for which I do not have the source code to is executing a third-party EXE file. I'd like to find out the arguments that it is sending to the EXE file (i.e. thirdparty.exe -c "foo" -d "bar"). I do know that the initial program is written in Visual Basic. Are there any tools that I can run that will monitor the execution call a...

C# Compact-Framework friendly command line parser

I read this question: Command Line Parser for .NET. I thought that was what I was looking for, but the library Command Line Parser Library is not Compact framework friendly... I REALLY don't want to write a CL parser and I have been drifting away from the real purpose of my little app because of this unfortunate trial. Does someone kn...