Jump to content
Sign in to follow this  
Guest Joccunha

HELP - Script migration DOS for AutoIt

Recommended Posts

Guest Joccunha

Good morning for all.

I am needing to do in AutoIt the routine that before was in DOS and it stopped working when I installed Windows XP because it doesn't recognize "% "

copy \\M023082\CNC\REDE1\USIEIXOS.A\CNCWEG\FACEAD_4\PRINCIPAL\%1.NC C:\CNC8070\USERS\PRG\PRINCIPAL.NC

copy \\M023082\CNC\REDE1\USIEIXOS.A\CNCWEG\FACEAD_4\PROG2\%1.NC C:\CNC8070\USERS\PRG\PROG2.NC

copy \\M023082\CNC\REDE1\USIEIXOS.A\CNCWEG\FACEAD_4\PROG1\%1.NC C:\CNC8070\USERS\PRG\PROG1.NC

In DOS% was to type the name of the file.

I am Brazilian and I don't write very well in English. Excuse me

Share this post


Link to post
Share on other sites
LxP

Is this what you want? --

fileCopy("\\M023082\CNC\REDE1\USIEIXOS.A\CNCWEG\FACEAD_4\PRINCIPAL\" & $cmdLine[1] & ".NC", "C:\CNC8070\USERS\PRG\PRINCIPAL.NC")
fileCopy("\\M023082\CNC\REDE1\USIEIXOS.A\CNCWEG\FACEAD_4\PROG2\" & $cmdLine[1] & ".NC", "C:\CNC8070\USERS\PRG\PROG2.NC")
fileCopy("\\M023082\CNC\REDE1\USIEIXOS.A\CNCWEG\FACEAD_4\PROG1\" & $cmdLine[1] & ".NC", "C:\CNC8070\USERS\PRG\PROG1.NC")

Share this post


Link to post
Share on other sites
Guest Joccunha

Thanks for your help but it didn't work. It follows mistake msg.

---------------------------

AutoIt Error

---------------------------

Line 0 (File "U:\Script\AutoIT\emerson\importCNC.exe"):

fileCopy("\\M023082\CNC\REDE1\USIEIXOS.A\CNCWEG\FACEAD_4\PRINCIPAL\" & $cmdLine[1] & ".NC", "C:\CNC8070\USERS\PRG\PRINCIPAL.NC")

fileCopy("\\M023082\CNC\REDE1\USIEIXOS.A\CNCWEG\FACEAD_4\PRINCIPAL\" & ^ ERROR

Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded.

---------------------------

OK

---------------------------

Share this post


Link to post
Share on other sites
LxP

You need to call the script with a parameter (as you did for the DOS batch file):

"U:\Script\AutoIT\emerson\importCNC.exe" myParameter

The $cmdLine[1] in the code above is equivalent to the %1 in the batch file.

Share this post


Link to post
Share on other sites
CNCMONKEY

You need to call the script with a parameter (as you did for the DOS batch file):

"U:\Script\AutoIT\emerson\importCNC.exe" myParameter

The $cmdLine[1] in the code above is equivalent to the %1 in the batch file.

Thank you, I also tried something like this but failed to use a parameter. great explanation

Share this post


Link to post
Share on other sites
JoHanatCent

The previous .bat file should still work as before.

You'll have to identify the file that needs to be copied out from:

\\M023082\CNC\REDE1\USIEIXOS.A\CNCWEG\FACEAD_4\PRINCIPAL\?????.nc

to the three new locations.

Then do:

"U:\Script\AutoIT\emerson\importCNC.exe" ?????

Edited by JoHanatCent

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.