Jump to content
Sign in to follow this  
KwanKwan

The variable

Recommended Posts

I am trying to launch a program by using AutoIt. Here is the code from the batch file

"C:\Program Files\Autodesk\ACADM 2008\acad.exe" /p "C:\ACAD Configuration\CKProfile.arg" %1 %2 %3 %4

Anyone knows how to make it work with AutoIt?

Share this post


Link to post
Share on other sites

 Try this:

ShellExecuteWait("C:\Program Files\Autodesk\ACADM 2008\acad.exe", '/p "C:\ACAD Configuration\CKProfile.arg" %1 %2 %3 %4')

Edited by taietel

Share this post


Link to post
Share on other sites

Thanks!

The Message I have from the program (AutoCAD) is:

Cannot find the spefified drawing file. Please verify that the file exists.

Share this post


Link to post
Share on other sites

Thanks.

The arguments %1 %2 %3 %4 is something needed by the Data Management software here. When I use the batch file to launch AutoCAD, it works fine. But ... Just cannot figure out how I can make it work with AutoIt. Is there anyway I can send/receive the arguement?

Share this post


Link to post
Share on other sites

Are these arguments being sent to the AutoIt script then? If they are, you can use the $CmdLine variable.

$args = '/p "C:\ACAD Configuration\CKProfile.arg"'
For $i = 1 To $CmdLine[0]
    $args &= ' "' & $CmdLine[1] & '"'
Next
ShellExecuteWait("C:\Program Files\Autodesk\ACADM 2008\acad.exe", $args)

Something like this should work.

Share this post


Link to post
Share on other sites

You would, of course, replace "%1 %2 %3 %4" with actual parameters:

$sExtCmd = 'C:\Program Files\Autodesk\ACADM 2008\acad.exe'
$sParam1 = '"My New Drawing Name"'
$sParam2 = '/p "C:\MyDrawings\ACADProfile.arg"'
$sParam3 = '/s "C:\Lisp;C:\VBA"'
$sParam4 = '/t "C:\MyDrawings\MyTemplate.dwt"'
$sParam5 = '/nologo'
$sAllParams = $sParam1 & ' ' & $sParam2 & ' ' & $sParam3 & ' ' & $sParam4 & ' ' & $sParam5
ShellExecuteWait($sExtCmd, $sAllParams)

:idea:

Edit: Way too slow today! :)

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...