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.
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
Re: Make network drive ready.
@Sabrina: I'm trying to figure out why you posted Java & Bat commands in a VB.net forum.
Re: Make network drive ready.
Quote:
Originally Posted by
formlesstree4
@Sabrina: I'm trying to figure out why you posted Java & Bat commands in a VB.net forum.
:rolleyes:
Bump, i dont suppose anyone knows of a way to do this in vb.net lol ?