Zithen Posted October 27, 2005 Share Posted October 27, 2005 can u add vbs into a autoit script or can you only add autoit to a vbs script? basicly have a vbs script and want to add it to a already existing autoit script so that we dont have to keep calling the .vbs file everytime we want to run this. want to make it 1 file. i know autoit and i dont know vbs and vis versa for him, and we cant work together on this (work reasons). Link to comment Share on other sites More sharing options...
Valuater Posted October 27, 2005 Share Posted October 27, 2005 one way to combine the two.. is to compile your vbs script then in Autoit $Program_1 = @TempDir & "\Temp.exe" FileInstall("C:\vbs.exe", $Program_1) ; scripting Run($Program_1) 8) Link to comment Share on other sites More sharing options...
Zithen Posted October 27, 2005 Author Share Posted October 27, 2005 thx i will give that a shotone way to combine the two.. is to compile your vbs script thenin Autoit$Program_1 = @TempDir & "\Temp.exe" FileInstall("C:\vbs.exe", $Program_1) ; scripting Run($Program_1)8) Link to comment Share on other sites More sharing options...
ptrex Posted October 27, 2005 Share Posted October 27, 2005 Most VB scripts can be converted to AutoIT.look here for the Tools to convert the VBscripthttp://www.autoitscript.com/forum/index.ph...topic=12143&hl= Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
erifash Posted October 27, 2005 Share Posted October 27, 2005 Try using AutoIt as a vbs script wrapper, just put the vbs code in a string in the program:Global $oVBS $oVBS = ObjCreate("ScriptControl") $oVBS.language="vbscript" $oVBS.addcode($SOME_VB_CODE_HERE) Func _vb($param) Return $oVBS.run("A_FUNCTION_IN_THE_VBS_CODE", $param) EndFunc My UDFs:_FilePrint() | _ProcessGetName() | _Degree() and _Radian()My Scripts:Drive Lock - Computer Lock Using a Flash DriveAU3Chat - Simple Multiuser TCP ChatroomStringChunk - Split a String Into Equal PartsAutoProxy - Custom Webserver Link to comment Share on other sites More sharing options...
ter-pierre Posted November 28, 2005 Share Posted November 28, 2005 erifash, excuse my poor knowledgment about, but please help me. I have a short VBS that returns an AD object attribute, listed above: set objUser = getobject ("LDAP://cn=tstusr,ou=TESTS,dc=test,dc=net") wscript.echo objuser.company How can I use your sudgestion applying this vbs? I needs to use the output of this VBS on my AutoIT script. Thanks Pierre Link to comment Share on other sites More sharing options...
randallc Posted November 28, 2005 Share Posted November 28, 2005 Hi,Does this old link help?Use VBscript with AutoIt : a method, :-) Michel ClaveauBest, randallPS see i have twice used this type of method, writing the variables within the script, in "ExcelCom.au3", link from my signature... ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
ter-pierre Posted November 28, 2005 Share Posted November 28, 2005 Great! Its running fine.... except to W98 workstations... I have the vbs... on error resume next set objUser = getobject ("LDAP://cn=tstusr,ou=TESTS,dc=test,dc=net") wscript.echo objuser.company and write the follow AutoIT... $VBS='on error resume next' $VBS=$VBS&@CRLF&'set objUser = getobject ("LDAP://cn=tstusr,ou=TESTS,dc=test,dc=net")' $VBS=$VBS&@CRLF&'function test()' $VBS=$VBS&@CRLF&'TESTE=objuser.company' $VBS=$VBS&@CRLF&'end Function' $vbscript = ObjCreate("ScriptControl") $vbscript.language="vbscript" $vbscript.addcode($VBS) $VBOUT = $vbscript.run("test") MsgBox(0,"Test",$VBOUT) Exit the W98 returns an error: $vbscript.language="vbscript" $vbscript^ERROR Error:Variable must be of type "Object" Can you help? Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted November 28, 2005 Share Posted November 28, 2005 (edited) Most likely ObjCreate is throwing an error. Check the helpfile in case I might be wrong, but: If $vbscript < 0 Then MsgBox(0, 'ObjCreate', 'Error Occured: Type' & $vbscript) Exit EndIf Edited November 28, 2005 by MSLx Fanboy Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
DaleHohm Posted November 28, 2005 Share Posted November 28, 2005 Most likely ObjCreate is throwing an error. Check the helpfile in case I might be wrong, but: If $vbscript < 0 Then MsgBox(0, 'ObjCreate', 'Error Occured: Type' & $vbscript) Exit EndIfThis is most likely. My guess to the cause is that since Win98 have V1.0 of Windows Script Host it does not have what you need. Download WSH V5.6 for Win98 from MSDN More info on WSH here Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
ter-pierre Posted December 21, 2005 Share Posted December 21, 2005 I update the WSH and install DSClient, and still not running, reporting the same error... Some one can help me? 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