I'm using Ver. 3.62 and need to insert the IP address of the remote computer that I'm also executing the "getdrivespace" on. The ip that is returned is the ip of the machine that the script is executed from. I'd like to enter the ip of the remote machine but haven't been able to so far.

Thanks for any help.

code:
;Setconsole ("HIDE")
$engine = "dao.dbengine.36"
$database = "c:\inetpub1\wwwroot\db1.mdb"
$dbe = olecreateobject ( "$engine" )
$dbs = Val ( "&" + olecallfunc ( $dbe, "opendatabase", "s", "$database" ))
$Space = GetDiskSpace("\\romburner\c$")
$Server = "romburner"
$Drive = "C"
Gosub "Calculate"
Gosub "WriteToFile"
$Space = GetDiskSpace("\\romburner\d$")
$Server = "romburner"
$Drive = "D"
Gosub "Calculate"
Gosub "WriteToFile"
$Space = GetDiskSpace("\\towens2k\c$")
$Server = "towens2k"
$Drive = "C"
Gosub "Calculate"
Gosub "WriteToFile"
$Space = GetDiskSpace("\\towens2k\d$")
$Server = "towens2k"
$Drive = "D"
Gosub "Calculate"
Gosub "WriteToFile"

GoTo "End"
:WriteToFile
;$X = Writeline (1, "Free Space On $Server $Drive Drive: " + "$ErrMsg" + Chr(013) + Chr(010))
$rs = olecallfunc ( $dbs, "execute", "s","INSERT INTO TABLE3 (Dato,Server,Drive,Space,Ip) VALUES ('@Date','$Server','$Drive','$ErrMsg', [B]'@ipaddress0'[/B] );")
If @error GoTo End EndIf
Return
:Calculate
Select
Case $Space < 1024 ;** Kilobytes
$Space = $Space * 100
$Units = " Kilobytes"
Case $Space => 1024 AND $Space < 1048576 ;** Megabytes
$Space = ($Space * 100) / 1024
$Units = " Megabytes"
Case $Space => 1048576 ;** Gigabytes
$Space = $Space / 10486
$Units = " Gigabytes"
EndSelect
;** Convert the $Space value to a string by adding a space to the beginning
$Space = " " + $Space
$Length = Len($Space)

;** Add the decimal point 2 spaces from the end.
$Space = SubStr($Space, 1, $Length - 2) + "." + SubStr($Space,$Length - 1, 2)
$ErrMsg = LTrim($Space)
Return
:End
If $dbe
$rs= olereleaseobject ( $dbe )
EndIf
If $dbs
$rs= olereleaseobject ( $dbs )
EndIf


_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain