Jump to content

Trouble copying files


Recommended Posts

I have a script that creates a folder and copies files to it. If I run it on the computer by double clicking the complied script it works fine. If I push it out to the computer and tell it to run via a batch file (start c:\temp\7_02_install.exe) it creates the directory but does not copy the files. Any thoughts? here is the script

DirCreate("c:\temp\lotus")

DirCopy("\\coaaltiris\Software\Public\Client_notes\Lotus Notes Client 7.0.2\Clients\W32Intel\","c:\temp\lotus",1)

Do

If FileExists("c:\temp\lotus\Lotus Notes 7.0.2.msi") Then

run("c:\windows\system32\msiexec.exe /i ""c:\temp\lotus\Lotus Notes 7.0.2.msi"" TRANSFORMS=""c:\temp\lotus\Lotus Notes 7.0.2.mst"" /qb")

Else

Sleep (5000)

EndIf

until FileExists("c:\temp\lotus\Lotus Notes 7.0.2.msi")

Exit

Alan

Link to comment
Share on other sites

I have a script that creates a folder and copies files to it. If I run it on the computer by double clicking the complied script it works fine. If I push it out to the computer and tell it to run via a batch file (start c:\temp\7_02_install.exe) it creates the directory but does not copy the files. Any thoughts? here is the script

DirCreate("c:\temp\lotus")

DirCopy("\\coaaltiris\Software\Public\Client_notes\Lotus Notes Client 7.0.2\Clients\W32Intel\","c:\temp\lotus",1)

Do

If FileExists("c:\temp\lotus\Lotus Notes 7.0.2.msi") Then

run("c:\windows\system32\msiexec.exe /i ""c:\temp\lotus\Lotus Notes 7.0.2.msi"" TRANSFORMS=""c:\temp\lotus\Lotus Notes 7.0.2.mst"" /qb")

Else

Sleep (5000)

EndIf

until FileExists("c:\temp\lotus\Lotus Notes 7.0.2.msi")

Exit

Alan

Test that the source path is valid in the execution environment:
$sSource = "\\coaaltiris\Software\Public\Client_notes\Lotus Notes Client 7.0.2\Clients\W32Intel\"
If FileExists($sSource) Then
     DirCopy($sSource,"c:\temp\lotus",1)
Else
     Msgbox(16, "Error", "Source path invalid:  " & $sSource)
EndIf

muttley

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

Thanks PsaltyDS

Source seems to be fine. I do not get the message box. When I click on the AutoIt icon in the task bar it say script paused. It executes "DirCreate("c:\temp\lotus")"

and then seems to pause. Is there a way to send the script to a computer not compiled. I have Autoit installed on my test computer i am using but I am trying to push this out via Altiris deployment console. I could try copying the .au3 to the ltest pc and try running it, if that will work. Can you run a autoit script with out compiling and with out installing AutoIt.

Alan

Link to comment
Share on other sites

There is a portable version of Autoit, that you can just unzip (remember to enable folders) and use.

If you do not have any includes in your script, you could just deploy the AutoIt3.exe (w/o the rest of the files).

Thanks PsaltyDS

Source seems to be fine. I do not get the message box. When I click on the AutoIt icon in the task bar it say script paused. It executes "DirCreate("c:\temp\lotus")"

and then seems to pause. Is there a way to send the script to a computer not compiled. I have Autoit installed on my test computer i am using but I am trying to push this out via Altiris deployment console. I could try copying the .au3 to the ltest pc and try running it, if that will work. Can you run a autoit script with out compiling and with out installing AutoIt.

Alan

Link to comment
Share on other sites

As DaRam said, you could deploy just the AutoIt3.exe (found in your installation directory) along with the .au3 file if you aren't using any of the AutoIt includes...

You'd execute such a script by calling

ShellExecute(@ScriptDir & "\AutoIt3.exe", @ScriptDir & "\MyScript.au3")

At least, thats how I think you'd do it. Not tested, thats just off the top of my head.

Link to comment
Share on other sites

I will give the portable version a try. I did find out what the problem was. The deployment server that was trying to run my script did not give the job any rights back to the server. So the script was asking for the files but the server would not give them to it. When I added the appropriate permission to the deployment job the script worked fine. There is always something asking for permissions somewhere.

Any way thanks for all the help.

Alan

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