Results 1 to 4 of 4

Thread: Make network drive ready.

  1. #1

    Thread Starter
    Junior Member rrafluap's Avatar
    Join Date
    Sep 2009
    Location
    Plymouth, England.
    Posts
    23

    Make network drive ready.

    Hey there, i have a NAS drive that is mapped to my system... My application will copy files to the drive but the only problem is the drive has a sleep function on it... therefore when i try to copy files to it and it is in sleep mode, it says the folder does not exist (drive still in my computer but just with a red X on it)

    is there a function to make ir ready ? the only other way to do it is to double click the drive icon in my computer then it wakes up... but id rather not do this as its a pain.

    i know you can check to see if its ready or not but i was wondering if i could make it ready??


    thanks, Paul.

  2. #2
    Banned
    Join Date
    Aug 2009
    Posts
    33

    Re: Make network drive ready.

    If windows XP, try the method below:
    1.BIOS, enable WOL
    2.Build a task:
    echo +++++++++++++++++++++++++++++++++++++++++++++++++
    echo start: %date% %time% > _Update_IP.log 2>>&1
    java Sleep >> _Update_IP.log 2>>&1
    net use W: /delete >> _Update_IP.log 2>>&1
    net use W: \\192.168.0.2\lnx_share your_password /user:your_name >> _Update_IP.log 2>>&1
    ipconfig /all > W:\desktop_win_ip.txt
    echo end: %date% %time% >> _Update_IP.log 2>>&1
    echo +++++++++++++++++++++++++++++++++++++++++++++++++


    Note: Replace IP(192.168.0.2) to your IP Adress.
    3.Compile Sleep.java to Sleep.class and copy it to your bat Path. The code of Sleep.java is shown as below:
    public class Sleep {
    public static void main(String[] args) throws Exception{
    long sleepSeconds = 3 * 60 * 1000L;//default: 3 minutes


    if(args.length == 1) {
    try {
    sleepSeconds = Long.parseLong(args[0]);
    }
    catch(Exception ex) {
    //ignore, use the default value
    }
    }
    System.out.println("Begin to sleep " + sleepSeconds/60000 + " minute(s)");
    Thread.currentThread().sleep(sleepSeconds);
    System.out.println("End sleep.");
    }
    }

    ----------------------------------
    Sabrina Gage
    Last edited by si_the_geek; Apr 7th, 2010 at 05:30 PM. Reason: removed advertising link

  3. #3

    Re: Make network drive ready.

    @Sabrina: I'm trying to figure out why you posted Java & Bat commands in a VB.net forum.

  4. #4

    Thread Starter
    Junior Member rrafluap's Avatar
    Join Date
    Sep 2009
    Location
    Plymouth, England.
    Posts
    23

    Question Re: Make network drive ready.

    Quote Originally Posted by formlesstree4 View Post
    @Sabrina: I'm trying to figure out why you posted Java & Bat commands in a VB.net forum.


    Bump, i dont suppose anyone knows of a way to do this in vb.net lol ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width