jefhal Posted September 8, 2005 Share Posted September 8, 2005 My AutoIT script runs as a shell script within an Active Directory custom console. It picks up the system name, the mac ids, the express service code(Dell), and the service tag(Dell) and puts them into the Active Directory Computer description field. Right now it runs semi-automatically through AutoIT. That is, after generating the description, it pastes it into the "description" field by sending the contents of the clipboard. I'd like to make this happen through ADSI though. That means I have to pass the description to the vbs script. If the vbs script looks like this: On Error Resume Next Wscript.StdOut.Write "Please enter the name of the computer you want to connect to: " strComputer = WScript.StdIn.ReadLine If strComputer = "" Then Wscript.Quit End If Set objComputer = GetObject("WinNT://" & strComputer & "") objComputer.Filter = Array("User") For Each objUser in objComputer Wscript.Echo objUser.Name Next ' End How would I pass the AutoIT variable $description into the vbs script? The vbs script is expecting a command line that looks like this: c:>MyVBScript.vbs $description Should I use StdINWrite? I can't figure this out based on the helpfile example. Thank you! ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 8, 2005 Share Posted September 8, 2005 try running "whatever program actually executes .vbs extension""C:\MyVBScript.vbs""desc..." Link to comment Share on other sites More sharing options...
Wus Posted September 8, 2005 Share Posted September 8, 2005 (edited) are you just enumerating the users with the vbs script? you could easily do that with autoit I may completely be off though. EDIT: Oh, I dont know much about passing variables. I will play around with it and see if i can help though. Edited September 8, 2005 by Wus Link to comment Share on other sites More sharing options...
jefhal Posted September 8, 2005 Author Share Posted September 8, 2005 are you just enumerating the users with the vbs script? you could easily do that with autoitI may completely be off though.<{POST_SNAPBACK}>I'm using this script to create computer descriptions, although that was not clear from the code snippet I showed (that was to show how to bring data into vbs using stdin). For example, we have an "OU" called "Main Office" that contains 4 computers (comp100, comp101, comp102...). I select one of the computer names and press the Active Directory custom task button to run my AutoIT script. The script gets the computer name (comp100) from the built-in Active Directory variables, and then gets the Dell service tag, the Dell express service code, the mac id for the wired nic, and the mac id for the wireless nic. It then concatenates the strings into a "description" which I put into the AutoIT variable: $description. It looks like: ~ 5928v31 ~ 1892486732 ~ 00-0a-bc-de-f9-d2 ~ 00-2c-59-ab-bc-de ~I now want to send the contents of $description into a command line that runs a vbs to modify the Active Directory description field for that computer. Whew! Everything is done except the part where I feed $description into the vbs script. In the script will be something like: "objUser.Description = $description", etc. ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format Link to comment Share on other sites More sharing options...
randallc Posted September 8, 2005 Share Posted September 8, 2005 Hi, I don't know the answer to your question; can't you just use an "ini" file write and read that; [ if on same computer; or even registry read/write?] At least as a workaround if you prefer the other? Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
/dev/null Posted September 8, 2005 Share Posted September 8, 2005 (edited) How would I pass the AutoIT variable $description into the vb script:set args=wscript.arguments description = args(0) Wscript.Echo descriptionCheersKurt Edited September 8, 2005 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
jefhal Posted September 8, 2005 Author Share Posted September 8, 2005 AU3:$description = "whatever"; $scriptpath = "C:\MyVBScript.vbs" $scriptparam = $description RunWait($scriptpath & " " & $scriptparam)Dear IceKirby1, /dev/null and all-Thanks again for reminding me of the subtleties of code writing. The answer was right under my nose and you pointed it out to me. I was trying to make it more complicated than necessary... ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now