I need to make a script that runs when a user logs in and does a check to see if their internet connection is active, and if so, copies a file to a certain location. My thoughts were to somehow have the script check to see if ping is successful and if so run the copy command. here is what I have but I am not skilled in batch file scripting or kixtart too much. Below is the idea but it doesn't work.

Code:

IF /i ("ping google.com") EQU (1)

THEN

	copy c:\somefile.exe c:\somelocation
ELSE

	exit




thanks for any help