IP アドレスとコンピュータ名を取得し、デフォルトのメール クライアントをポップアップするスクリプトを実行しようとしています。メールで変数を取得する方法がわかりません..どんな助けでも大歓迎です!
Set objShell = CreateObject("Wscript.Shell")
Set objEnv = objShell.Environment("Process")
strComputer = objEnv("COMPUTERNAME")
strUser = "Scanner.User"
strPass = "SomePassword"
Set colAccounts = GetObject("WinNT://" & strComputer & ",computer")
Set objUser = colAccounts.Create("user", strUser)
objUser.SetPassword strPass
Const ADS_UF_DONT_EXPIRE_PASSWD = &h10000
objPasswordExpirationFlag = ADS_UF_DONT_EXPIRE_PASSWD
objUser.Put "userFlags", objPasswordExpirationFlag
objUser.SetInfo
Set Group = GetObject("WinNT://" & strComputer & "/Administrators,group")
Group.Add(objUser.ADspath)
temp = "select IPAddress from Win32_NetworkAdapterConfiguration "& _
"where IPEnabled=TRUE"
temp2 = "winmgmts:{impersonationLevel=impersonate}"
set IPConfigSet = GetObject(temp2).ExecQuery(temp)
for each IPConfig in IPConfigSet
if Not IsNull(IPConfig.IPAddress) then
for i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
objShell.Run("mailto:MyEmail@address.com&subject=strComputer&body=IPConfig.IPAddress(i)")
Msgbox IPConfig.IPAddress(i)
next
end if
next