「WScript ドメイン、ユーザー情報を取得する」の版間の差分
ナビゲーションに移動
検索に移動
1行目: | 1行目: | ||
− | ==WScript ドメイン、ユーザー情報を取得する== | + | ==[[WScript ドメイン、ユーザー情報を取得する]]== |
[[WScript]] | | [[WScript]] | | ||
− | ===VBScript=== | + | ===[[VBScript]]=== |
− | Set nt = WScript.CreateObject("WScript.Network") | + | Set nt = [[WScript]].CreateObject("[[WScript]].Network") |
msg = "Domain = " & nt.UserDomain & vbcrlf _ | msg = "Domain = " & nt.UserDomain & vbcrlf _ | ||
& "Computer Name = " & nt.ComputerName & vbcrlf _ | & "Computer Name = " & nt.ComputerName & vbcrlf _ | ||
& "User Name = " & nt.UserName | & "User Name = " & nt.UserName | ||
− | WScript.Echo msg | + | [[WScript]].Echo msg |
13行目: | 13行目: | ||
//ドメイン情報を取得する | //ドメイン情報を取得する | ||
− | var nt = WScript.CreateObject("WScript.Network"); | + | var nt = [[WScript]].CreateObject("[[WScript]].Network"); |
var msg = "Domain = " + nt.UserDomain | var msg = "Domain = " + nt.UserDomain | ||
+ "\nComputer Name = " + nt.ComputerName | + "\nComputer Name = " + nt.ComputerName | ||
+ "\nUser Name = " + nt.UserName; | + "\nUser Name = " + nt.UserName; | ||
− | WScript.Echo(msg); | + | [[WScript]].Echo(msg); |
2020年2月16日 (日) 04:34時点における最新版
WScript ドメイン、ユーザー情報を取得する
WScript |
VBScript
Set nt = WScript.CreateObject("WScript.Network") msg = "Domain = " & nt.UserDomain & vbcrlf _ & "Computer Name = " & nt.ComputerName & vbcrlf _ & "User Name = " & nt.UserName WScript.Echo msg
JScript
//ドメイン情報を取得する var nt = WScript.CreateObject("WScript.Network"); var msg = "Domain = " + nt.UserDomain + "\nComputer Name = " + nt.ComputerName + "\nUser Name = " + nt.UserName; WScript.Echo(msg);
© 2006 矢木浩人