Jump to content

HELP - Script migration DOS for AutoIt


Guest Joccunha
 Share

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

Link to comment
Share on other sites

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")
Link to comment
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

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 5 years later...

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

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