Jump to content

Problem with script


Recommended Posts

Hi,

I had a problem with the following code. Info: I'm using win98se, this line of code will let me copy a template folder structure by using xcopy command.

RunWait(@ComSpec & ' /c C:\WINDOWS\COMMAND\xcopy.exe' & $sourcePath &" "& $destPath & " /y/t/e/i")

If I test run it within Scite editor with "F5", my script runs without problem. But if I compile/run the script in windows it give me an error of can't run external command...

Oh, I also notice after the script ended running in Scite editor, it gives a error of Bad command or file name.

Does anyone know whats the cause or how to resolve this?

Thanks in advance.

[font="Arial"]Thanks[/font]
If @error = me Then $sorry
Else
   Do
      $clarifyMe
   Until $meClear
EndIF
MsgBox(0,"Special Message!","Special Thanks to " & $allHadReplied,$Forever)
Link to comment
Share on other sites

Hi guys,

I tried out both your suggestions but both doesn't work.

It gives the following error when I run the compile script:

Line 38 (File "C:\WINDOWS\DESKTOP\test.au3"):

RunWait(@ComSpec & ' /c xcopy "' & $sourcePath & '" "' & $destPath & '" /y/t/e/i', "", @SW_HIDE)

Error: Unable to execute the external program.

A device attached to the system is not functioning.

And have an error of the following when I run in Scite with {F5}:

>Running: C:\Program Files\AutoIt3\AutoIt3.exe /ErrorStdOut "C:\WINDOWS\Desktop\test.au3"

0 File(s) copied

Invalid number of parameters

>AutoIT3.exe ended.

>Exit code: 0 Time: 14.290

Is it that win98 does not have certain parameters of xcopy?

[font="Arial"]Thanks[/font]
If @error = me Then $sorry
Else
   Do
      $clarifyMe
   Until $meClear
EndIF
MsgBox(0,"Special Message!","Special Thanks to " & $allHadReplied,$Forever)
Link to comment
Share on other sites

maybe the @comspec macro goes to a different .exe than 98 uses?

i dunno, i dont got a 98. you say it runs as script? hmmm.

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

I think you are still missing a space after your xcopy. You have "" instead of " "

Doublecheck your "double quotes" for spaces left out.

RunWait(@ComSpec & ' /c xcopy "' & $sourcePath & '" "' & $destPath & '" /y/t/e/i', "", @SW_HIDE)

<{POST_SNAPBACK}>

RocTx
Link to comment
Share on other sites

Thanks for the reply.

@t0ddie

maybe the @comspec macro goes to a different .exe than 98 uses?

I don't quite get you. I specified the specific location of which .exe to run in my previous post already and there isn't any second copy of xcopy on the system.

you say it runs as script?

I don't know what your run as script acutally mean. But in general, I only used 2 method to run the script. 1. Use the {F5} function in the scite IDE to run the script and the script can run and complete it tasks but when I close it, it will then display a short error msg. 2. I compile the script to an .exe file using right-click->complie and by doing this the script didn't complete the task due to the error msg pop-up and end the script as describe in my previous post. Does this help you?

@RocTx

I had already include the "s in the variable itself. Therefore it is not the issue with that... Anyway, I tried it and nothing different is achieve.

This is bordering me for this few days.... Can anyone please help me through with this? Advice of solution would be appreciate.

[font="Arial"]Thanks[/font]
If @error = me Then $sorry
Else
   Do
      $clarifyMe
   Until $meClear
EndIF
MsgBox(0,"Special Message!","Special Thanks to " & $allHadReplied,$Forever)
Link to comment
Share on other sites

I based my reply on this.

Run(@ComSpec & ' /c xcopy /e /h /y "' & $Folder1 & '" "' & $Folder2 & '"', "", @SW_HIDE)

Which I took from one of my scripts. I simply changes the variable names and added "/y/t/e/i".

The above works for me.

qq

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...