Sign in to follow this  
Followers 0
friends

How actually FileCopy() works ?

5 posts in this topic

Well... I've tested the FileCopy() function... I'm not sure if it is

working under restricted account in Windows 2000.

My idea is like that....

I do a mapped-drive (to other PC) using DriveMapAdd() function.

Afterwards, I wanted to copy files from mapped-drive to current

PC's C:\Program Files\test location.

Assume mapped-drive is X:

So, the syntax looks something like this :

FileCopy ("X:\*.bin", "C:\Program Files\test", 1)

However, I tested it in Windows 2000 (Restricted User) account,

it seems to be not working at all.

What had gone wrong with it ?

Please help. Thanks in advance

Share this post


Link to post
Share on other sites



Well... I've tested the FileCopy() function... I'm not sure if it is

working under restricted account in Windows 2000.

My idea is like that....

I do a mapped-drive (to other PC) using DriveMapAdd() function.

Afterwards, I wanted to copy files from mapped-drive to current

PC's C:\Program Files\test location.

Assume mapped-drive is X:

So, the syntax looks something like this :

FileCopy ("X:\*.bin", "C:\Program Files\test", 1)

However, I tested it in Windows 2000 (Restricted User) account,

it seems to be not working at all.

What had gone wrong with it ?

Please help. Thanks in advance

<{POST_SNAPBACK}>

What does this return? Does it say it is working?

Share this post


Link to post
Share on other sites

Is the file that you are trying to copy already in that directory? If so, then it will be copying it, but it will just be copying over the original file, and therefore not "show" anything.

Share this post


Link to post
Share on other sites

I know the below coding has many problems. This is what I wanted to do :

First of all, there are 2 PCs, one is PC1 (Restricted User) and another is

PC2, both are running LAN environment (Workgroup only).

I want to perform a map-drive from PC1 to a PC2, then check only the

latest modified date I want to copy. If the file does not exist in PC1, then

copy it over. That's all.....

Please help me to correct the coding below... I know it is very bad :)

RunAsSet("Administrator", @Computername, "erots")

   DriveMapAdd ("X:", "\\192.168.24.21\update")
   $path = @ProgramFilesDir & "\Grisoft\AVG6\UPDATE"
   $temp = FileGetTime ("C:\Program Files\Grisoft\AVG6\UPDATE\*.bin", 0)

   $search = FileFindFirstFile ("X:\*.bin")
             
   $val = FileCopy ("X:\Files.txt", "C:\Program Files\Grisoft\AVG6\UPDATE\", 1)

   WHILE 1 
        $file = FileFindNextFile($search)
        MsgBox (4096, "File :", $file)

        IF NOT @ERROR THEN
           $t = FileGetTime($file)

           IF NOT @ERROR THEN
              $mddyyy = $t[1] & "/" & $t[2] & "/" & $t[0]
              MsgBox (0, "Modified Date :", $mddyyyy)
           ENDIF     
        ENDIF
   WEND

   FileClose ($search)

   DriveMapDel ("X:")

RunAsSet()

Share this post


Link to post
Share on other sites

anybody mind to give a hand to see what's wrong with the coding ?

I'm unable to copy the file to the targeted PC..... help ! :)

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