joeloyzaga Posted September 9, 2014 Share Posted September 9, 2014 was looking at internet and found this to run via command line and wondered how to do it via autoit C:pathbin>call mdrv.exe -usr "c:testtestFotMdrv.usr" tried doing this and its come up with syntax errors (see attachment) #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile_type=a3x #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Run (C:Program Files (x86)HPUnified Functional Testingbinmdrv.exe -usr , "C:pwcPWC-QTPPWC-QTP.usr") Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 10, 2014 Moderators Share Posted September 10, 2014 Try something like this: $sPath = "C:\Program Files (x86)\HP\Unified Functional Testing\bin\mdrv.exe" ShellExecute($sPath, ' -usr , "C:\pwc\PWC-QTP\PWC-QTP.usr"') If @error Then ConsoleWrite("Run failed with error: " & @error & @CRLF) "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
computergroove Posted September 10, 2014 Share Posted September 10, 2014 #include <MsgBoxConstants.au3> $Path = "C:\path\bin\" $Exe = "call mdrv.exe" $Switch1 = "-usr" $Switch2 = '"' & "" & 'c:\test\testForMdv.usr' & '"' MsgBox(0,"",$Path & $Exe & " " & $Switch1 & " " & $Switch2) Here's a dirtier way of doing it. Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 10, 2014 Moderators Share Posted September 10, 2014 Are you trying to make a Rube Goldberg script?! "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
joeloyzaga Posted September 10, 2014 Author Share Posted September 10, 2014 I did not get an error it could capture - but I did get an error see attached Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 10, 2014 Moderators Share Posted September 10, 2014 So that tells you that the first half of the ShellExecute (the path to the file) is correct. You have an error in the command line parameters. Is there supposed to be a space between -user and the comma? Can you verify the 'C:pwcpwc-qtppwc-qtp.usr' file exists? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
joeloyzaga Posted September 10, 2014 Author Share Posted September 10, 2014 this is the code now #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile_type=a3x #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** $sPath = "C:Program Files (x86)HPUnified Functional Testingbinmdrv.exe" ShellExecute($sPath, ' -usr "C:pwcPWC-QTPPWC-QTP.usr"') If @error Then ConsoleWrite("Run failed with error: " & @error & @CRLF) seems to run it but nothing is started >"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:UsersJoe LoyzagaDesktopRun UFT.au3" /UserParams +>09:35:57 Starting AutoIt3Wrapper v.14.801.2025.0 SciTE v.3.4.4.0 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64 Environment(Language:0409) +> SciTEDir => C:Program Files (x86)AutoIt3SciTE UserDir => C:UsersJoe LoyzagaAppDataLocalAutoIt v3SciTEAutoIt3Wrapper SCITE_USERHOME => C:UsersJoe LoyzagaAppDataLocalAutoIt v3SciTE >Running AU3Check (3.3.12.0) from:C:Program Files (x86)AutoIt3 input:C:UsersJoe LoyzagaDesktopRun UFT.au3 +>09:36:02 AU3Check ended.rc:0 >Running:(3.3.12.0):C:Program Files (x86)AutoIt3autoit3.exe "C:UsersJoe LoyzagaDesktopRun UFT.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop +>09:36:03 AutoIt3.exe ended.rc:0 +>09:36:03 AutoIt3Wrapper Finished. >Exit code: 0 Time: 6.028 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 10, 2014 Moderators Share Posted September 10, 2014 Is the error message still coming up? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
joeloyzaga Posted September 12, 2014 Author Share Posted September 12, 2014 yes this is the actual command I use on the windows command line C:Program Files (x86)HPUnified Functional Testingbin>call mdrv.exe -usr "c:pwcPWC-QTPPWC-QTP.usr" How can I run it via autoit then? use the Run function? keep getting the syntax wrong Link to comment Share on other sites More sharing options...
Developers Jos Posted September 12, 2014 Developers Share Posted September 12, 2014 Try Shellexecute('C:Program Files (x86)HPUnified Functional Testingbinmdrv.exe','-usr "c:pwcPWC-QTPPWC-QTP.usr"','C:Program Files (x86)HPUnified Functional Testingbin') Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now