Example #1
0
def run_cmd(command):
    # os.system(command)
    pinfo = ProcessStartInfo()
    pinfo.FileName = "cmd.exe"
    pinfo.WindowStyle = ProcessWindowStyle.Hidden
    pinfo.Arguments = "/C" + command
    cmd = Process.Start(pinfo)
    cmd.WaitForExit()
Example #2
0
def start_imaging(path):
    psInfo = ProcessStartInfo()
    psInfo.FileName = path + "Imaging.exe"
    psInfo.Arguments = "Rowthon 1"
    psInfo.CreateNoWindow = False
    psInfo.UseShellExecute = False
    psInfo.RedirectStandardOutput = True

    p = Process.Start(psInfo)
Example #3
0
        def onEdit(sender, args):
            global program

            path = sender.Tag

            def onStart(state):
                Process.Start(state)

            psi = ProcessStartInfo()

            if String.IsNullOrEmpty(program):
                psi.FileName = path
            else:
                psi.FileName = program
                psi.Arguments = path

            Task.Factory.StartNew(onStart, psi)
Example #4
0
		def onEdit(sender, args):
			global program
				
			path = sender.Tag

			def onStart(state):
				Process.Start(state)
					
			psi = ProcessStartInfo()

			if String.IsNullOrEmpty(program):
				psi.FileName = path
			else:
				psi.FileName = program
				psi.Arguments = path
				
			Task.Factory.StartNew(onStart, psi)
    def launch_application(self, sut_path, args=None):
        """Launches an application.

        ``sut_path`` is the absolute path to the application to launch.

        ``args`` is a string of arguments to use when starting the application (optional).

        Examples:
        | Launch Application | C:/path/to/MyApp.exe | | # Launch without arguments |
        | Launch Application | C:/path/to/MyApp.exe | /o log.txt | # Launch with arguments |
        """
        if args is not None:
            process_start_info = ProcessStartInfo(sut_path)
            process_start_info.Arguments = args
            self.state.app = Application.Launch(process_start_info)
        else:
            self.state.app = Application.Launch(sut_path)