Jump to content
Sign in to follow this  
FordPrefect

Copying file from mapped drive

Recommended Posts

FordPrefect

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 :)

Share this post


Link to post
Share on other sites
Skruge

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]

Share this post


Link to post
Share on other sites
FordPrefect

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

Share this post


Link to post
Share on other sites
flyonthewall

thank you Skruge.

very nice.

great 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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.