Try this. This assumes that you have one network adapter, or at least that the first adapter enumerated is the one that you are interested in.

Code:
$sMyNetwork=IPDecimal(IPDecimal(EnumIpInfo(0,0)) & IPDecimal(EnumIpInfo(0,1)))
Select
Case $sMyNetwork='172.16.136.0' OR $sMyNetwork='172.16.137.0'
"Will Map X Drive" ?
Use X: /delete /persistent
use X: "\\apps\CDRoms"
If @ERROR "ERROR: Could not map X: ["+@ERROR+"] "+@SERROR+@CRLF EndIf
Case "Default"
"Will not map X drive" ?
EndSelect

; IPDecimal Dotted Quad <-> Network number conversion
Function IPDecimal($v)
If InStr($v,".")
For Each $v In Split($v,".") $IPDecimal=$IPDecimal+Right("00"+DecToHex($v),2) Next
$IPDecimal=Val("&"+$IPDecimal)
Else
; Convert to hex and zero fill to 32 bit.
; This avoids problems caused by twos complement representation
$v=Right("00000000"+DecToHex($v),8)
While $v
$IPDecimal=$IPDecimal+"."+Execute("Exit &"+Left($v,2))
$v=SubStr($v,3)
Loop
$IPDecimal=SubStr($IPDecimal,2)
EndIf
Exit 0
EndFunction