Coffeehouse Thread

6 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Mapping network drive - all the time... help needed!

Back to Forum: Coffeehouse
  • User profile image
    Raghavendra_​Mudugal

    is this can be done?


    say, \\<ip_address>\folder_name, i mapped it to drive letter Y:, every now and then this drive gets disconnected. there must me a way to get it connected all the time without losing the connection.

    casuse-

    actualy, I have a some file in c: drive, everyday at 7pm a batch file will be executed via scheduler to copy to Y: drive. some times it copies and some times it wont, and the file date and time will the previous one in Y: drive. I came to know this is happening due to drive getting disconnected (it shows red "x" mark in the icon, and sometime the Y: letter is not listed in, again I have to map them).


  • User profile image
    TommyCarlier

    Maybe you could modify the batch file, so it maps the drive automatically before copying the file(s).

    net use Y: \\<ip_address>\folder_name

  • User profile image
    Raghavendra_​Mudugal

    TommyCarlier said:
    Maybe you could modify the batch file, so it maps the drive automatically before copying the file(s).
    net use Y: \\<ip_address>\folder_name
    cool.

    I just modified the batch for checking purpose... for the first time it created the mapped drive and copied the files, i executed the same batch file again, now it gave me the following error...
    ==
    System error 85 has occurred.

    The local device name is already in use.
    ==

    and files did not copy. So how can it execute that line of code? i guess it should execute only if it is disconnected... is this possible to check if y: already exisits, if exisits then is that in diconnected mode, if yes then map the drive from batch, else just copy files...?

  • User profile image
    cheong

    Raghavendra_Mudugal said:
    TommyCarlier said:
    *snip*
    cool.

    I just modified the batch for checking purpose... for the first time it created the mapped drive and copied the files, i executed the same batch file again, now it gave me the following error...
    ==
    System error 85 has occurred.

    The local device name is already in use.
    ==

    and files did not copy. So how can it execute that line of code? i guess it should execute only if it is disconnected... is this possible to check if y: already exisits, if exisits then is that in diconnected mode, if yes then map the drive from batch, else just copy files...?

    Some batch programming will do:
    ==

    @echo off
    net use | find "Y:" > nul
    if errorlevel 1 net use Y: \\<ip_address>\folder_name

    Recent Achievement unlocked: Code Avenger Tier 4/6: You see dead program. A lot!
    Last modified
  • User profile image
    Raghavendra_​Mudugal

    cheong said:
    Raghavendra_Mudugal said:
    *snip*
    Some batch programming will do:
    ==

    @echo off
    net use | find "Y:" > nul
    if errorlevel 1 net use Y: \\<ip_address>\folder_name
    cheong;

    it works... thank you so much.


    and thank you tommy; for the root solution.

     Smiley

  • User profile image
    spivonious

    Just curious why you need to map it at all.  Why not just copy directly to the UNC address?

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.