I've been sitting on this for a few years now. Is it possible to get the command line as a string with no parsing/help from Hollywood/C/DOS/whatever? GetRawArguments() reads the greater-than sign as redirection rather than passing it as an argument. I need to capture and process everything myself including any redirection. GetCommandLine() doesn't get the command line either, instead it parses arguments. As a work around I use GetFileArgument() with quotes because everything between quotes is passed to my programs unchanged and unparsed. That means however, the user has to put quotes around anything with more than one argument and can't place quotes within the quotes. The work-around for that is to instruct the user to use "`" (grave) as pretend quotes. Thanks.
NathanH
arg$=GetRawCommandLine()
Re: arg$=GetRawCommandLine()
imho redirection and special characters pipe handling, are captured by OS , and program never access them.
workarounds like the one you use is only way
Also if the user types itself command line, and not passign them via "Execute()" of another script for exampleyou can use s$ = ReadConsoleStr()
another common use way is to write it to a file, and then read that file
etc
workarounds like the one you use is only way
Also if the user types itself command line, and not passign them via "Execute()" of another script for exampleyou can use s$ = ReadConsoleStr()
another common use way is to write it to a file, and then read that file
etc
Christos
- airsoftsoftwair
- Posts: 5830
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: arg$=GetRawCommandLine()
Plouf is right, it's not possible because things like pipe redirections are handled by the shell and programs have no clue about this. GetRawCommandLine() really is as raw as it gets, it returns directly what the shell passes to your program. Programs written in other languages like C can't get more than that either.
Re: arg$=GetRawCommandLine()
Thanks, I was thinking that may be the case.
NathanH
NathanH