|
-
Mar 8th, 2010, 08:12 AM
#1
Thread Starter
Junior Member
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.
-
Mar 8th, 2010, 08:55 PM
#2
Banned
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
-
Mar 9th, 2010, 01:00 AM
#3
Re: Make network drive ready.
@Sabrina: I'm trying to figure out why you posted Java & Bat commands in a VB.net forum.
-
Mar 10th, 2010, 01:17 PM
#4
Thread Starter
Junior Member
Re: Make network drive ready.
 Originally Posted by formlesstree4
@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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|