Jump to content

Copying file from mapped drive


Recommended Posts

Hi,

I just want to copy a file from a network share - username and pw are required.

Using "DriveMapAdd" only brings up "/run /prod /ErrorStdOut" when running the script.

DriveMapDel("L:")
DriveMapAdd("L:", "\\share", 0, "domain\user", "password")
FileCopy("L:\test.doc", "c:\test.doc")

I used the search, but didn´t find a solution.

Help please :)

Link to comment
Share on other sites

If DriveMapAdd fails, @error will tell you why. Consult the help file for the different values.

It's possible that L: is already mapped to something else. If all you're doing is copying a file, you don't need a drive letter assignment.

DriveMapAdd("", "\\server\share", 0, "domain\user", "password")
If @error Then
    MsgBox(0, "DriveMapAdd Error", @error)
Else
    FileCopy("\\server\share\test.doc", "c:\test.doc")
    DriveMapDel("\\server\share")
EndIf

Also, I'm not exactly sure what you mean by this:

Using "DriveMapAdd" only brings up "/run /prod /ErrorStdOut" when running the script.

It sounds like you're running it from within SciTE, but you don't have any output to display.

You can add some ConsoleWrite lines to track a script's progress.

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Link to comment
Share on other sites

Thanks Skruge - you made my day.

Your hints for "debugging" opened my eyes. Shame on me...

Everything worked fine: I was browsing the destination folder´s files ordered by "last modified" and couldn´t find the (old) copied file by current date :) .

Edited by FordPrefect
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...