1 #!/usr/bin/perl
2
3 use Win32::Process;
4 use Win32;
5 sub ErrorReport{
6 print Win32::FormatMessage( Win32::GetLastError() );
7 }
8 Win32::Process::Create($ProcessObj1, "Client.exe", "",
9 0, NORMAL_PRIORITY_CLASS, ".")|| die ErrorReport();
10 sleep(5);
11 Win32::Process::Create($ProcessObj2, "GndSystem.exe", "",
12 0, NORMAL_PRIORITY_CLASS, ".")|| die ErrorReport();
13 sleep(5);
14 Win32::Process::Create($ProcessObj3, "LmiInterface.exe", "",
15 0, NORMAL_PRIORITY_CLASS, ".")|| die ErrorReport();
16 sleep(5);
17 Win32::Process::Create($ProcessObj4, "Monitor.exe", "",
18 0, NORMAL_PRIORITY_CLASS, ".")|| die ErrorReport();
19 sleep(5);
20 #Win32::Process::Create($ProcessObj6, 'C:\Sim.exe', 'PACARS.sim', 0, NORMAL_PRIORITY_CLASS, 'C:\SecureACARS\Database')|| die ErrorReport();
21 system('C:\Sim.exe PACARS.sim');
另附上请空log文件的perl脚本:
1 #!/usr/bin/perl
2
3 open $Log, '> C:\GPAComm.log';
4 close $Log;
5 open $Log, '> C:\CoreError.log';
6 close $Log;
7 open $Log, '> C:\GPAError.log';
8 close $Log;