windows 7 - create user with custom shell using VBSCRIPT -
im using script create user... set shell "c:\app\myapp.exe" , user.. hope can fill in blanks me. thank you.. windows 7
set wshshell = wscript.createobject("wscript.shell") if wscript.arguments.length = 0 set objshell = createobject("shell.application") objshell.shellexecute "wscript.exe", """" & _ wscript.scriptfullname & """" &_ " runasadministrator", , "runas", 1 else strcomputer = "pc2" set colaccounts = getobject("winnt://" & strcomputer & "") set objuser = colaccounts.create("user", "admin2") objuser.setpassword "test" objuser.setinfo msgbox "done" end if
if understood this article correctly, need set this:
[hklm\software\microsoft\windows nt\currentversion\inifilemapping\system.ini\boot] "shell"="usr:software\microsoft\windows nt\currentversion\winlogon" and specify user-specific shell in shell value in software\microsoft\windows nt\currentversion\winlogon in user's registry hive (stored in ntuser.dat in user's profile, need load registry able modify it). if want vbscript, have use this:
set sh = createobject("wscript.shell") sh.run "reg load hku\temp c:\users\username\ntuser.dat", 0, true unload hive after you're finished:
sh.run "reg unload hku\temp", 0, true
Comments
Post a Comment