1

I need to do a Bat file (or something like that) that do a Incremental Backup of some especified folders when, and just when, the Ethernet Cable is connected.

How can I do it? I have no idea how can I start..

0

2 Answers 2

0

You need to create a Windows scheduler task that fires based on an event in the Event Log.

This previous answer will help: How to launch a command on network connection/disconnection?

You will probably need to add a delay as it takes quite a time for Windows to fully start the network and assign drives, etc.

Note that this assumes you are using Vista or above.

Do actually do the backup, try looking up the help for the Robocopy or xcopy commands.

0

This PowerShell code will show you all installed adapters, and their connection status.

Get-WmiObject -Class Win32_NetworkAdapter | Format-Table -Property Name, NetConnectionStatus -AutoSize

Status of 2 means connected. There are more details and in-depth examples on the Hey, Scripting Guy! site.

This article gives you more options, if PowerShell is not your thing - you could do something similar with netsh.

Not the answer you're looking for? Browse other questions tagged .