Sign in to follow this  
Followers 0
chiners_68

FileCopy not working...

9 posts in this topic

Hi All,

I have setup a file copy for an autoIT exe file to the startup after a reboot. Ive tested with the original script file bot now need to copy the compiled EXE file.. i have the line below but its not working... any onwe help here..

FileCopy("\\server\it$\Software\Other\Microsoft\Visual Studio\disk1\Visual Studio 6.0 Install P2.exe", @StartupDir)

i have check & double checked the UNC path & file name (rename & Copy text to make sure) but it dosent work now with the exe file copy.

Share this post


Link to post
Share on other sites



You have spaces in your path.

Try this:

FileCopy('"\\server\it$\Software\Other\Microsoft\Visual Studio\disk1\Visual Studio 6.0 Install P2.exe"', @StartupDir)

Share this post


Link to post
Share on other sites

Ive tried that it dosent seem to work

FileCopy('"\\ebc-img-01\it$\Software\Other\Microsoft\Visual Studio\disk1\Visual Studio 6.0 Install P2.exe"', @StartupDir)

Share this post


Link to post
Share on other sites

Yeah, but you may have overlooked reading the examples in the helpfile. It would tell you that it can recognize @StartupDir as a file rather then a folder so try using a backslash after @StartupDir and see if that solves your problem.

If this is a reboot and continue install, then I would recommend using HKCU\...\RunOnce as the method to restart your automation. I would assume that Visual Studio 6.0 would also start from that key and the entry would not require removal as it is done automatically. I have a reboot script that does this and works fine to complete the 2nd half of install with another program I have.

:D

Share this post


Link to post
Share on other sites

ill have a go with the backslash..

I tried originally using runonce but it runs & waits when i need it to go into windows fully for a MSDN window to apear & then run. startup folder was working a treat till i compiled the script.

i have changed UNC path so im now thinking it dosent like the space in the UNC path. it seems ok with spaces in the filename but possibly not the UNC path.

Share this post


Link to post
Share on other sites

Be sure to use HKCU and not HKLM as HKLM does wait while HKCU executes after desktop loads and does not wait.

Share this post


Link to post
Share on other sites

Problem solved... Mcafee sudenly decided to deny access to the startup folder.. disabled the Network Associates Mcshield Service temp. & it worked fine.

Share this post


Link to post
Share on other sites

Due to the Problem with Mcafee now I need to use the registry. can somone help with the correct script to add the correct key for this exe to run in the runonce. ive knocked somethig up but dont think its right.

SET KEY=HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce

REG ADD %KEY%\001 /V /D "\"\\ebc-img-01\it$\Software\Other\Microsoft\Visual Studio\disk1\Visual Studio 6 Install P2.exe\"

Share this post


Link to post
Share on other sites

; Call function when needed.
_RunOnce()

Func _RunOnce()
    ; Add 2nd part to installation.
    Local $key = 'HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce'
    If @Compiled Then
        RegWrite($key, '_VisualStudio', 'Reg_sz', '"' & @ScriptFullPath & '" /postrun')
    Else
        RegWrite($key, '_VisualStudio', 'Reg_sz', '"' & @AutoItExe & '" "' & @ScriptFullPath & '" /postrun')
    EndIf
EndFunc

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  
Followers 0