jloyzaga Posted July 9, 2015 Share Posted July 9, 2015 (edited) this is the command in my bat filecscript.exe "C:\pwc\RunThisTest.vbs" "C:\pwc\Ipower New Client"and the file is called Run Ipower Automation.batI'm pretty sure I'd use the_RunDos command - would I run the command or the file? Edited July 9, 2015 by jloyzaga Link to comment Share on other sites More sharing options...
JohnOne Posted July 9, 2015 Share Posted July 9, 2015 (edited) You can run or shellexecute the bat file, or probably this will work...Run('cscript.exe "C:\pwc\RunThisTest.vbs" "C:\pwc\Ipower New Client"') Edited July 9, 2015 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 9, 2015 Moderators Share Posted July 9, 2015 Or convert the vbscript to AutoIt, and save yourself the hassle of mixing scripting languages "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...
jloyzaga Posted July 9, 2015 Author Share Posted July 9, 2015 The reason I used vbscript is because I couldn't get autoit to work this is the vbscript '*******************************************************************'RunThisTest'by Michael Innes'November 2012testResourcePath = "C:\pwc\Logs\"'Getting the test pathDim objArgsSet objArgs = wscript.ArgumentstestPath = objArgs(0)'Determining that the test does existDim objFSOSet objFSO = CreateObject("Scripting.FileSystemObject")DoesFolderExist = objFSO.FolderExists(testPath)Set objFSO = NothingIf DoesFolderExist Then Dim qtApp 'Declare the Application object variable Dim qtTest 'Declare a Test object variable Set qtApp = CreateObject("QuickTest.Application") 'Create the Application object qtApp.Launch 'Start QuickTest qtApp.Visible = True 'Make the QuickTest application visible qtApp.Open testPath, False 'Open the test in read-only mode Set qtTest = qtApp.Test 'Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object 'qtResultsOpt.ResultsLocation = testResourcePath ' Specify the location to save the test results. 'qtTest.Run qtResultsOpt,True 'Run the test and wait until end of the test run qtTest.Run 'Run the test qtTest.Close 'Close the test qtApp.QuitElse 'Couldn't find the test folder. That's bad. Guess we'll have to report on how we couldn't find the test. 'Insert reporting mechanism here.End If Link to comment Share on other sites More sharing options...
JohnOne Posted July 9, 2015 Share Posted July 9, 2015 What is the AutoIt script that will not work? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
jloyzaga Posted July 10, 2015 Author Share Posted July 10, 2015 #Region ;**** Directives created by AutoIt3Wrapper_GUI ****#AutoIt3Wrapper_Outfile_type=a3x#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****$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) Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 10, 2015 Moderators Share Posted July 10, 2015 This is how I would do (untested) your vbscript. Sticking with the args method in the VBScript, you would need to compile to exe and then pass the $testPath argument as a command line. Something like this:Run with args pointing $testPath to C:\Temp\Temp: C:\Users\Me\Desktop\test.exe /C:\Temp\Temp#include <MsgBoxConstants.au3> If Not @Compiled Then Exit(MsgBox($MB_OK + $MB_ICONWARNING, "", "This script must be compiled and run from the command line, passing the appropriate arguments")) $testResourcePath = "C:\pwc\Logs\" ;Getting the test path $testPath = $CmdLine[1] ;Determining that the test does exist If FileExists($testPath) Then $qtApp = ObjCreate("QuickTest.Application") ;Create the Application object If IsObj($qtApp) Then $qtApp.Launch ;Start QuickTest $qtApp.Visible = True ;Make the QuickTest application visible $qtApp.Open($testPath, False) ;Open the test in read-only mode $qtTest = $qtApp.Test $qtTest.Run ;Run the test $qtTest.Close ;Close the test $qtApp.Quit Else MsgBox($MB_OK + $MB_ICONERROR, "My Script", "Failed to Create QuickTest Object") EndIf Else MsgBox($MB_OK + $MB_ICONERROR, "My Script", "Test path does not exist.") EndIf "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...
jloyzaga Posted July 14, 2015 Author Share Posted July 14, 2015 sorry but what would the /C:\Temp\Temp be pointing to? so what would the command line be? is the C:\Users\Me\Desktop\test.exe the compiled autoit script as above? Sorry for being vague Link to comment Share on other sites More sharing options...
jloyzaga Posted July 14, 2015 Author Share Posted July 14, 2015 c:\pwc\N3T\runuft1.exe /C:\pwc\PWC-QTP\PWC-QTP.usr is the command i used and I keep getting "Test path does not exist."but its there Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 14, 2015 Moderators Share Posted July 14, 2015 I'm not sure how to make it any clearer, but I'll try: C:\Users\Me\Desktop\test.exe is the path to your executable that you type into the run line. /C:\Temp\Temp is the argument you pass to the script. As I stated in my previous post, this is the path to the folder you want to point to. It looks like you're pointing at a file. "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...
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