bkemmler Posted June 9, 2005 Author Share Posted June 9, 2005 (edited) Personally I would rather the WScript.Echo get converted to ConsoleWrite.<{POST_SNAPBACK}>The next release (v0.4) is converting it to a function which is writing the echo to a log file. But if you want to use ConsoleWrite you just need to modify the VATable.txt file (beginning from v0.4).Just change the line where you can find the text WScript.Echo:WScript.Echo|ConsoleWrite|0|0|1|If you want to use the MsgBox, you must write a wrapper arround MsgBox:e.g.Func _MyMsgBox($strText) MsgBox(0,"Some Text",$strText) EndFuncSave this wrapper in a Include file (e.g msg.au3) and change the line in the VATable.txt file like this:WScript.Echo|_MyMsgBox|0|0|1|msg.au3But keep in mind. WScript.Echo can be used from Version 0.4. It should be release tomorrow.I hope i could help you. Edited June 9, 2005 by bkemmler Link to comment Share on other sites More sharing options...
bkemmler Posted June 10, 2005 Author Share Posted June 10, 2005 Version 0.4 can be download Link to comment Share on other sites More sharing options...
drak Posted September 15, 2005 Share Posted September 15, 2005 (edited) Don't know if your still working on this as the last post date was "Jun 9 2005" but just incase, this is a sample of an output i got when using your script so it needs a little bit more yet expandcollapse popup; ---------------------------------------------------------------------------- ; ; VBScript to AutoIt Converter v0.4 ; ; ---------------------------------------------------------------------------- #include <bk-logfile.au3> #include <date.au3> Const $SEC_IN_DAY = 86400 Const $ADS_UF_DONT_EXPIRE_PASSWD = &h10000 $objUserLDAP = ObjGet _ ("LDAP://CN=myerken,OU=management,DC=fabrikam,DC=com") $intCurrentValue = $objUserLDAP.Get("userAccountControl") If $intCurrentValue and $ADS_UF_DONT_EXPIRE_PASSWD Then _WriteLog ("The password does not $EXPIRE.") Else $dtmValue = $objUserLDAP.PasswordLastChanged _WriteLog ("The password was last changed on " & _) DateValue($dtmValue) & " at " & TimeValue($dtmValue) & @CRLF & _ "The difference between when the password was last set" & _ "and today is " & int(_Now() - $dtmValue) & " days" $intTimeInterval = int(_Now() - $dtmValue) $objDomainNT = ObjGet("WinNT://fabrikam") $intMaxPwdAge = $objDomainNT.Get("MaxPasswordAge") If $intMaxPwdAge < 0 Then _WriteLog ("The Maximum Password Age is set to 0 in the " & _) "domain. Therefore, the password does not $EXPIRE." Else $intMaxPwdAge = (intMaxPwdAge/SEC_IN_DAY) _WriteLog ("The maximum password age is " & $intMaxPwdAge & " days") If $intTimeInterval >= $intMaxPwdAge Then _WriteLog ("The password has expired.") Else _WriteLog ("The password will $EXPIRE on " & _) DateValue($dtmValue + $intMaxPwdAge) & " (" & _ int(($dtmValue + $intMaxPwdAge) - _Now()) & " days from today" & _ ")." EndIf EndIf EndIf the issues are: the second CONST statement Autoit doesn't like the Value the _WriteLog lines that are wrapped but the close ")" is put on the first line instead of the last line on this line the Variables intMaxPwdAge & SEC_IN_DAY weren't updated with $ : $intMaxPwdAge = (intMaxPwdAge/SEC_IN_DAY) The DateValue & TimeValue functions weren't converted other than that your very close to having a fully functional converter keep up the good work Edited September 15, 2005 by drak Link to comment Share on other sites More sharing options...
randallc Posted September 18, 2005 Share Posted September 18, 2005 (edited) Hi,I have changed a converted script a little, but it still does not work to sort an excel sheet as the vbscript does.I think there is a bug in the "sort" call in AutoIt3; any way to tell before i post it to bugs?Thanks, Randall; ----------------------------------------------------------------------------;; VBScript to AutoIt Converter v0.4;; ----------------------------------------------------------------------------Dim $oXLConst $xlDescending = 2Const $xlAscending = 1Const $xlGuess = 0Const $xlTopToBottom = 1 $oXL = ObjCreate("Excel.Application")$oXL.Visible = 1; BEGIN CALLOUT A;$FilePath=@ScriptDir&"\book1.xls"$FilePath="C:\Program Files\Au3PROGS\SciTe\book1.xls"$oXL.Workbooks.Open($FilePath); END CALLOUT A$oXL.Worksheets(1).Activate$oXL.ActiveCell.CurrentRegion.Select(); BEGIN CALLOUT B;**********************************************************************;* Excel Sort Method Syntax:;* expression.Sort(Key1, Order1, Key2, Type, Order2, Key3, Order3,;* Header, OrderCustom, MatchCase, Orientation, SortMethod);*;* Notice that blank entries are supplied for Type (fourth argument),;* Key3 (sixth argument), and Order3 (seventh argument).;**********************************************************************$oXL.Selection.Sort ($oXL.Worksheets(1).Range("A2"),2, $oXL.Worksheets(1).Range("B2"), , 1, ,, $xlGuess,1, 0,0, $xlTopToBottom); END CALLOUT B Edited September 24, 2005 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
w0uter Posted September 18, 2005 Share Posted September 18, 2005 instead of converting it you could call vbscript directly using COM & the ScriptControl object. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
randallc Posted September 18, 2005 Share Posted September 18, 2005 Thanks, I can do it lots of complex ways, but i'd like to know the AutoIt COM is working OK! - Wouldn't you? Thanks, Randall PS1 - I would actually just call my Excel macro to do it! PS2 - I would be interested to update my knowledge too; what is the "ScriptControl"? - not in help file? ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
w0uter Posted September 18, 2005 Share Posted September 18, 2005 "ScriptControl" is an object. witch you can create with the COM functions. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
randallc Posted September 18, 2005 Share Posted September 18, 2005 Ah, yes, found on forum search, thanks. Is this why this converter has not had so much usage or development? - is everyone using the scriptcontrol and not bothering to convert? Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Rahul Rohela Posted October 12, 2005 Share Posted October 12, 2005 HI i have checked V0.4 its not working Gving following error.. Please help or send working to rrohela@yahoo.com Line 76 (File "C:\Script tool\AutoIt\Mycript\Examples\Convert\Vaconvert.au3") $intStep += 1 $intStep ^ERROR Error: Expected a "=" Operator in assignment statement. Please help... Link to comment Share on other sites More sharing options...
GaryFrost Posted October 12, 2005 Share Posted October 12, 2005 HI i have checked V0.4 its not working Gving following error.. Please help or send working to rrohela@yahoo.comLine 76 (File "C:\Script tool\AutoIt\Mycript\Examples\Convert\Vaconvert.au3")$intStep += 1$intStep ^ERRORError: Expected a "=" Operator in assignment statement.Please help... You need the beta version of autoit SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Dickb Posted October 12, 2005 Share Posted October 12, 2005 Just played around with version 0.4 and some VB scripts from my work. I found a "Do while - loop" in one of the scripts which was not translated. I've added two lines to the VATable.txt file to solved this. Do While|While|0|0|0| Loop|WEnd|0|0|0| Don't know if this is sufficient, but it worked for my VB script. @bkemmler: Thanks for your work on this. Link to comment Share on other sites More sharing options...
SvenP Posted January 11, 2006 Share Posted January 11, 2006 Hi,I have changed a converted script a little, but it still does not work to sort an excel sheet as the vbscript does.I think there is a bug in the "sort" call in AutoIt3; any way to tell before i post it to bugs?Thanks, Randall......I've explained this problem in the bugs forum.Regards,-Sven Link to comment Share on other sites More sharing options...
lyledg Posted March 24, 2006 Share Posted March 24, 2006 HI I am getting errors running this now, has the functionality changed a lot since it's release? Link to comment Share on other sites More sharing options...
Dirk Diggler Posted August 10, 2006 Share Posted August 10, 2006 how i do use "NULL" values in autoitscipt? Source vbs code has NULL parameter for a function, this script can't do anything with it, so in au3 this function is called with parameter "NULL". And as result au3 is not compilable 8-) Link to comment Share on other sites More sharing options...
ptrex Posted August 10, 2006 Share Posted August 10, 2006 If you show the VBScript source and AU source, maybe we can help. 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...
Dirk Diggler Posted August 10, 2006 Share Posted August 10, 2006 Const JOIN_DOMAIN = 1 Const ACCT_CREATE = 2 Const ACCT_DELETE = 4 Const WIN9X_UPGRADE = 16 Const DOMAIN_JOIN_IF_JOINED = 32 Const JOIN_UNSECURE = 64 Const MACHINE_PASSWORD_PASSED = 128 Const DEFERRED_SPN_SET = 256 Const INSTALL_INVOCATION = 262144 strDomain = "FABRIKAM" strPassword = "ls4k5ywA" strUser = "shenalan" Set objNetwork = CreateObject("WScript.Network") strComputer = objNetwork.ComputerName Set objComputer = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" & _ strComputer & "\root\cimv2:Win32_ComputerSystem.Name='" & _ strComputer & "'") ReturnValue = objComputer.JoinDomainOrWorkGroup(strDomain, _ strPassword, strDomain & "\" & strUser, NULL, _ JOIN_DOMAIN + ACCT_CREATE) See the last 2 strings. AU3: Const $JOIN_DOMAIN = 1 Const $ACCT_CREATE = 2 Const $ACCT_DELETE = 4 Const $WIN9X_UPGRADE = 16 Const $DOMAIN_JOIN_IF_JOINED = 32 Const $JOIN_UNSECURE = 64 Const $MACHINE_PASSWORD_PASSED = 128 Const $DEFERRED_SPN_SET = 256 Const $INSTALL_INVOCATION = 262144 $strDomain = "FABRIKAM" $strPassword = "ls4k5ywA" $strUser = "shenalan" $objNetwork = ObjCreate("WScript.Network") $strComputer = $objNetwork.ComputerName $objComputer = ObjGet("winmgmts:{impersonationLevel=Impersonate}!\\" & _ $strComputer & "\root\cimv2:Win32_ComputerSystem.Name='" & _ $strComputer & "'") $ReturnValue = $objComputer.JoinDomainOrWorkGroup($strDomain, _ $strPassword, $strDomain & "\" & $strUser, NULL, _ $JOIN_DOMAIN + $ACCT_CREATE) Link to comment Share on other sites More sharing options...
ptrex Posted August 10, 2006 Share Posted August 10, 2006 @Dirk Diggler You can use "" or Try Chr(0) (this is ASCII code for NULL character) Let me know if it was a success. ptrex 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...
DaleHohm Posted August 10, 2006 Share Posted August 10, 2006 You should be able to use the keyword Default in place of Null. 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...
sneakysmith12 Posted January 13, 2007 Share Posted January 13, 2007 does it work in reverse out of curiosity? Yeah I'm not the greatest at DarkBasic either, but I'm good enough for a link :D A Thread of a W.I.P. that im making Link to comment Share on other sites More sharing options...
ptrex Posted January 13, 2007 Share Posted January 13, 2007 @sneakysmith12 It only work in 1 direction, so far. Regards ptrex 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...
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