1

I've created a simple program for moving files around in a system running win 7 embedded. I've run into a strange "bug" with my software and the way it handles startups.

    static void Main(string[] args)
    {
        if (Flagger.GetFlag().Contains("Processing") || args.Contains("batch"))
        {
            Run();
        }
        return;
    }

The way I've chosen to handle the different ways this program will be executed, I've created a simple way of seeing whether it is being executed as a part of the systems startup procedure, or called by a batch file.

The batch file is meant to be called by a trigger in the SQL-server and run a handful of programs for logging and such. While testing this on my workstation it executes and passes the parameters like it is supposed to do, but in the embedded system, no parameters is given to the program through the batch file.

start Pack.exe -batch
exit

I have tried several different methods of writing the batch file(with/without citation marks, start-exit) but to no avail. What could be causing the batch file to not pass the arguments to the Packer?

Mwigs
  • 231
  • 1
  • 14

1 Answers1

1
Starts a separate window to run a specified program or command.
START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/WAIT] [/B] [command/program]
[parameters]

Could it be, that you're passing qouted string as the first parameter to start command? If so, it handles it like a window title. Compare

start "c:\windows\notepad.exe"

and this

start "test" "c:\windows\notepad.exe"

Then you should just add a title param to start program. Also consider to use cmd /C instead.

Ivan Samygin
  • 4,210
  • 1
  • 20
  • 33
  • 1
    Read the question, the problem occurs when I try to use the same command on the windows 7 embedded system, but works perfectly fine on my laptop running windows 7 enterprise. – Mwigs Jul 08 '14 at 12:12
  • 1
    Hm-m - can you try to use cmd /C instead of start? – Ivan Samygin Jul 08 '14 at 12:26
  • 1
    `CMD /c` worked as intended: `CMD /c Green_Packer.exe batch`. But how come my original script doesn't work when I switch system? – Mwigs Jul 11 '14 at 11:50
  • Can't try on Win7 embedded. But I guess it's a bug if it reproduces on a clean fresh installation. – Ivan Samygin Jul 14 '14 at 06:58