| |
AlucarD
Posts: 2
Score: 0
Joined: 10/13/2008
Status: offline
|
Original message moved by dm_4ever Reason : Moving to appropriate forum Hello All! I need help with my script. It change password for admin on remote host. I want to that script ask me for old passwd and then ask me for new passwd and open txt file with list of ip address and do sCommand for every line in that file. Sorry for my english and thanks a lot for help. This is the code i wrote. Option Explicit Const MyApp = "Passwd Change" Const Netsend = "C:\psexec.exe" Const WindowStyle = 0 Const WaitOnReturn = False Dim sCommand, sSendto, sOldpasswd, sPasswd Dim oSh On Error Resume Next If Not IsWinnt() Then WScript.Echo "Run this script under Windows NT 4.0 or higher" WScript.Quit(1) End If sOldpasswd = InputBox("Type Old Admin Passwd", MyApp) If sOldpasswd = "" Then WScript.Quit(1) sPasswd = InputBox("Type New Admin Passwd", MyApp) If sPasswd = "" Then WScript.Quit(1) sSendto = InputBox("Type Host IP Adress", MyApp) If sSendto = "" Then WScript.Quit(1) sCommand = Netsend & " \\" & sSendto & " -u administrator" & " -p " & sOldpasswd & " net user administrator" & " " & sPasswd Set oSh = CreateObject("WScript.Shell") oSh.Run sCommand, WindowStyle, WaitOnReturn Set oSh = Nothing Private Function IsWinnt() Const OSNT = "Windows_NT" Dim oSh Dim sOS IsWinnt = False Set oSh = CreateObject("WScript.Shell") sOS = oSh.ExpandEnvironmentStrings("%OS%") Set oSh = Nothing If sOS = OSNT Then IsWinnt = True End Function
|
|