Re: Serious newb here with external exe questions...



On Mar 17, 1:52 pm, Mark Janssen <mpc.jans...@xxxxxxxxx> wrote:
On Mar 17, 11:39 am, Ralf Fassel <ralf...@xxxxxx> wrote:





* rfw...@xxxxxxxxx
| exec $rmtshare \\\\jack\\$newValue$=c:\\test\\profiles\\$newValue$ /GRANT everyone:full

Assuming that your newsreader inserted line breaks where there are none
in the code, the above statement gives the following on my windows:

    % exec test_argc rmtshare \\\\jack\\$newValue$=c:\\test\\profiles\\$newValue$ /GRANT everyone:full
    4
    1/4 {rmtshare}
    2/4 {\\jack\tdurden$=c:\test\profiles\tdurden$}
    3/4 {/GRANT}
    4/4 {everyone:full}

I'm calling test_argc which is a program to simply print the individual
arguments passed to it (see attached code).  Seems ok to me.  So the
next step at your side would either also use such a program to see what
is actually arriving at the exec'd side, or use TWAPI as someone else
suggested (if this is an option).

R'

/* test_argc.c -- print number of arguments excluding program name to stdout */
#include <stdio.h>
#include <string.h>

int
main(int argc, char *argv[]) {
  printf("%d\n", argc-1);
  for (int i =1; i < argc; i++) {
    printf("%d/%d {%s}\n", i, argc-1, argv[i]);
  }
  printf("\n");
  return argc-1;}

/* End of file */

Note that this debugging application gives rise to an additional layer
of command line parsing by the C library and it's not necessarily the
case that the ACL command line applications even use an argv array.
The windows CreateProcess API call takes the whole commandline as a
single string (and this should be reflected in [exec] behaviour on
windows IMO) To know exactly what was passed to createprocess, use
WinMain or add some debugging code to the call in the [exec]
implementation.

Regards,
Mark

Note that in this case this doesn't differ. The command line sent to
CreateProcess is:

rmtshare \\jack\tdurden$=c:\test\profiles\tdurden$ /GRANT
everyone:full

As returned by:

#include <windows.h>

int WinMain (
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow ) {

MessageBox (NULL, lpCmdLine,"Arguments",MB_OK);
return 0;
}

.



Relevant Pages

  • Re: connecting 2 createprocess - like piping in DOS - how?
    ... >> How can this be done in windows using createprocess ... > The redirection is done by the command processor (cmd.exe on NT ... > CreateProcess in the STARTUPINFO record. ...
    (borland.public.delphi.language.objectpascal)
  • Re: How to Launch IE to a specific URL?
    ... Use CreateProcess, which is wrapped in OpenNETCF.Process for you. ... URL on the command line to the IE program, ... Paul T. ... > Windows .NET is not supported in .NET CF. ...
    (microsoft.public.dotnet.framework.compactframework)
  • RE: re-setting boot partition
    ... Description of the Windows 2000 Recovery Console ... For a Microsoft Windows XP version of this article, ... MB of hard disk space on your system partition to hold the Cmdcons folder ... Windows NTBoot Console Command Interpreter. ...
    (microsoft.public.win2000.setup_upgrade)
  • RE: Win2000 Upgrade to SP3 Express Setup error.
    ... Start your computer with the Windows Setup floppy disks, ... MB of hard disk space on your system partition to hold the Cmdcons folder ... Windows NTBoot Console Command Interpreter. ... you cannot copy a file from the local hard disk to a floppy disk. ...
    (microsoft.public.win2000.setup_upgrade)
  • Re: gnome-list Digest, Vol 109, Issue 9
    ... You got a blinking command prompt. ... Prior to Mac and Windows, ... gnome3, yet another negative feedback ... DE developers, you have my support. ...
    (GNOME)