dspent 0 Posted December 22, 2004 There is a local group on every machine called REMOTE CONTROL OPERATORS,what i need to do is add about 12 domain users to this group on each NT/XP/2000 machine.The command line way to do this is:NET LOCALGROUP NAME OF LOCAL GROUP /ADD "USERNAME TO ADD"How do I use AutoIt to do this for every machine on the network. Share this post Link to post Share on other sites
Doxie 0 Posted December 22, 2004 Please first read the help file, and try to come up with a script, and if you can't get it working, i will gladly help you. Were ever i lay my script is my home... Share this post Link to post Share on other sites
Doxie 0 Posted December 22, 2004 Ok, i help you, since my dinner is in the owen From the FAQ5. How can I run a DOS program from within AutoIt?If you wanted to run something like a DOS "Dir" command then you must run it though the command interpreter (command.com or cmd.exe depending on your OS). The @Comspec macro contains the correct location of this file. You should use the RunWait() function as it waits for the DOS program to finish before continuing with the next line of the script. Here is an example of running the DOS Dir command on the C: drive: (effectively running the command command.com /c Dir C:\ ) RunWait(@COMSPEC & " /c Dir C:\")Wich means your could would look something like this:RunWait(@COMSPEC & " /c NET LOCALGROUP NAME OF LOCAL GROUP /ADD "USERNAME TO ADD"") Sleep (3000) RunWait(@COMSPEC & " /c NET LOCALGROUP NAME OF LOCAL GROUP /ADD "USERNAME TO ADD"") Sleep (3000) RunWait(@COMSPEC & " /c NET LOCALGROUP NAME OF LOCAL GROUP /ADD "USERNAME TO ADD"") Sleep (3000) RunWait(@COMSPEC & " /c NET LOCALGROUP NAME OF LOCAL GROUP /ADD "USERNAME TO ADD"") Sleep (3000) RunWait(@COMSPEC & " /c NET LOCALGROUP NAME OF LOCAL GROUP /ADD "USERNAME TO ADD"") Sleep (3000) RunWait(@COMSPEC & " /c NET LOCALGROUP NAME OF LOCAL GROUP /ADD "USERNAME TO ADD"") Sleep (3000) RunWait(@COMSPEC & " /c NET LOCALGROUP NAME OF LOCAL GROUP /ADD "USERNAME TO ADD"") Sleep (3000) RunWait(@COMSPEC & " /c NET LOCALGROUP NAME OF LOCAL GROUP /ADD "USERNAME TO ADD"") Sleep (3000) RunWait(@COMSPEC & " /c NET LOCALGROUP NAME OF LOCAL GROUP /ADD "USERNAME TO ADD"") Sleep (3000) RunWait(@COMSPEC & " /c NET LOCALGROUP NAME OF LOCAL GROUP /ADD "USERNAME TO ADD"") Sleep (3000) RunWait(@COMSPEC & " /c NET LOCALGROUP NAME OF LOCAL GROUP /ADD "USERNAME TO ADD"") Sleep (3000) RunWait(@COMSPEC & " /c NET LOCALGROUP NAME OF LOCAL GROUP /ADD "USERNAME TO ADD"") MsgBox(4096, "Done", "You are now done", 10) Were ever i lay my script is my home... Share this post Link to post Share on other sites
dspent 0 Posted December 22, 2004 and how do I run that on every machine on the network...? Share this post Link to post Share on other sites
ioliver 0 Posted December 22, 2004 (edited) and how do I run that on every machine on the network...?<{POST_SNAPBACK}>Do you have a Server? If so, you can make it part of the logon script... OrSearch for a program called PSEXEC...Hope that helps,Ian Edited December 22, 2004 by ioliver "Blessed be the name of the Lord" - Job 1:21Check out Search IMF Share this post Link to post Share on other sites
Doxie 0 Posted December 23, 2004 You put the script above on a share everyone can acccess. Then you add some lines in your login script. This is a copy of my login script, of course you can't use the exact same. :NEWPATCH REM ******************************************************************** REM ** Installs new patch ** REM ******************************************************************** IF EXIST \\xp2app02\Win2000\tools\PatchTool\USERS\%COMPUTERNAME%.DONE GOTO NEWPATC2 "\\xp2app02\Win2000\tools\PatchTool\patchtool.exe" GOTO SCREEN As you can see it first check for a file that is created by my script, in this case patchtool.exe. If the file exist then goto next thing in the login script. If not, then run the patchtool. So in you code above you could add a line, where it create a file for each user that have run the script. You can look after Iniwrite in the help file. All this would help, so it does not try to run it several times. Were ever i lay my script is my home... Share this post Link to post Share on other sites
Domonoky 0 Posted December 23, 2004 (edited) Hi.. i think the easiest thing is the use of psexec, a tool from sysinternal (freeware). With this tool you could remotly execute your script on the PC´s. And i think it should be simplier, using a batch file instead of an autoit script.. mfg Domo Edited December 23, 2004 by Domonoky Share this post Link to post Share on other sites
Doxie 0 Posted December 23, 2004 Of course it would be simplier to use batch file... But would it be as much fun as with AutoIt, i doubt that Were ever i lay my script is my home... Share this post Link to post Share on other sites