Wednesday, 15 April 2015

vb.net - Running SETX from Visual Basic -



vb.net - Running SETX from Visual Basic -

at moment, building programme in visual basic 2010 professional. when button pressed, need next run...

shell(cmd.exe) sendkeys.send("setx ccdeviceid " & deviceid & "") sendkeys.send() sendkeys.send("{enter}") sendkeys.send("exit") sendkeys.send("{enter}") shell("c:\python27\python c:\fusiontechnology\stage1.py") sendkeys.send("{enter}") sendkeys.send("exit")

and works, python script starts running before setx command completes. ideas on how can wait setx run , finish before executing next command?

thanks!

i utilize system.diagnostics.process class, this;

dim vprocess diagnostics.process vprocess = process.start("setx.exe", "ccdeviceid " & deviceid) vprocess.waitforexit() vprocess = process.start("c:\python27\python", "c:\fusiontechnology\stage1.py")

saves messing commands in shell 1 line @ time!

vb.net shell

No comments:

Post a Comment