Jump to content

Recommended Posts

Posted (edited)

Hi guys, I'm new to autoit. I've been using it for a couple weeks now to do basic things and I wanted to get into a little more advanced scripting. here is a snippit of code from a cmd file I have.

set D3BPPATH=\\d3fs03\install\Randomcompany
set ADMIN=%D3BPPATH%\Admin\Scripting
set LUMPATH=\\d3fs03\install\CatiaV5\LUM
set SITECODE=GV

IF NOT "%CLEARED%"=="Y" cls
set CLEARED=Y

:BP13CHX
echo Checking for BlockPoint 13 Installation....
if exist c:\cax\vendor\ds\hfx\b19sp3hfx16\. goto BP13X02
echo.
echo Blockpoint 13.0 NOT FOUND - Installing Blockpoint 13.0 now!
echo (Blockpoint 13.0x02 will be installed after Blockpoint 13)
echo.
call %D3BPPATH%\BP_13.0\%SITECODE%_BP.cmd
echo.
echo.

:BP13X02
REM *******************************************
REM * vERSION VARIABLES - ANY SITE
REM *
REM * THESE VALUES WILL NEED TO BE UPDATED
REM * AT vERSION LEVEL
REM *******************************************
set VERPATH=%D3BPPATH%\BP13.0X02
set IVTXVER=4.7
set IVTPATH=4.7.19

:lowdisk
echo Checking for disk space....
call cscript.exe %ADMIN%\lowdisk.vbs //nologo
if %ERRORLEVEL%==1 goto END

I'm trying to figure out how to convert this to an exe format with autoit. it seems to run fine with all but the "set" options but i can't seem to find the proper way to rewrite it. and help or pushes in the right direction would be great, I by no means want anyone to rewrite it for me just some links or something that may explain it better would be nice thanks.

Edited by Sam1el
Posted

Look up the help file for Variables, FileExists(), ShellExecute(), ConsoleWrite(), if it's going to be a console application.. Goto is not supported in AutoIt, use conditional statements instead.

Posted

This won't be entirely accurate but it should give you a start.

$D3BPPATH = "\\d3fs03\install\Randomcompany"
$ADMIN = $D3BPPATH & "\Admin\Scripting"
$LUMPATH = "\\d3fs03\install\CatiaV5\LUM"
$SITECODE = "GV"
BP13CHX()

Func BP13CHX()
    SplashTextOn("", "Checking for BlockPoint 13 Installation")
    If NOT FileExists("c:\cax\vendor\ds\hfx\b19sp3hfx16\") Then BP13X02()
    Local $sNotfound = "Blockpoint 13.0 NOT FOUND - Installing Blockpoint 13.0 now!" & @CRLF & _
            "Blockpoint 13.0x02 will be installed after Blockpoint 13"
    SplashTextOn("", $sNotfound)
    ShellExecuteWait($D3BPPATH & "\BP_13.0\" & $SITECODE & "_BP.cmd")
    SplashOff()
EndFunc   ;==>BP13CHX

Func BP13X02()
    #cs
        ;*******************************************
        ;* vERSION VARIABLES - ANY SITE
        ;*
        ;* THESE VALUES WILL NEED TO BE UPDATED
        ;* AT vERSION LEVEL
        ;*******************************************
    #ce
    Local $VERPATH = $D3BPPATH & "\BP13.0X02"
    Local $IVTXVER = "4.7"
    Local $IVTPATH = "4.7.19"
    SplashTextOn("", "Checking for disk space....")
    ShellExecuteWait("cscript.exe", $ADMIN & "\lowdisk.vbs //nologo")
    If @Error Then
        SplashOff()
        Exit ;; Not sure what you want to do here but it's probably Exit
    EndIf
EndFunc   ;==>BP13X02

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...