Jump to content
ufukreis1212

vbs convert au3 (help)

Recommended Posts

ufukreis1212

Hello, I am new members. Help me please. I want vbs convert to au3 .

This vbs code : 

'deneme
Set SystemSet = GetObject("winmgmts:").InstancesOf ("Win32_OperatingSystem") 
strOSArch = GetObject("winmgmts:root\cimv2:Win32_OperatingSystem=@").OSArchitecture
Set objNetwork = CreateObject("Wscript.Network")
Set wshShell = CreateObject( "WScript.Shell" )
strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
Set oShell = WScript.CreateObject("WScript.Shell")
proc_arch = oShell.ExpandEnvironmentStrings("%PROCESSOR_ARCHITECTURE%")
Set oEnv = oShell.Environment("SYSTEM")

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colMB = objWMIService.ExecQuery("Select * from Win32_BaseBoard") 
Set colCSes = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem") 
Set colProcessors = objWMIService.ExecQuery("Select * from Win32_Processor") 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") 
Set colItemsx = objWMIService.ExecQuery( _
    "SELECT * FROM Win32_VideoController",,48)
'-------------------------------------------------------------------

Set obj = GetObject("winmgmts:").InstancesOf("Win32_PhysicalMemory") 
i = 1
For Each obj2 In obj 
memTmp1 = obj2.capacity / 1024 / 1024
TotalRam = TotalRam + memTmp1 
i = i +1
Next
'--------------------------------------------------------------------
Dim objWMIService   : Set objWMIService  = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select Architecture from Win32_Processor")
For Each objItem in colItems
    if objItem.Architecture = 0 then 
       strArchitecture = "x86"
    end if
    if objItem.Architecture = 9 then 
       strArchitecture = "x64"
    end if
next
'--------------------------------------------------------------------
strComputer = "." ' Local computer
strMemory = ""
i = 1
      
set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
set colItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemory")

For Each objItem In colItems

	if strMemory <> "" then strMemory = strMemory & vbcrlf
	strMemory = strMemory &  "Bank" & i & " : " & (objItem.Capacity /1024 /1024) & " Mb"
	i = i + 1
Next
installedModules = i - 1

Set colItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemoryArray")

For Each objItem in colItems
	totalSlots = objItem.MemoryDevices
Next
'----------------------------------------------------------------------
Set objWMISvc = GetObject( "winmgmts:\\.\root\cimv2" )
Set colItems = objWMISvc.ExecQuery( "Select * from Win32_ComputerSystem" )
For Each objItem in colItems
    strComputerDomain = objItem.Domain
Next
for each System in SystemSet
For Each objItem in colItemsx
For Each objProcessor in colProcessors
For Each bbType In colMB   
MbVendor = bbType.Manufacturer
MbModel = bbType.Product
MsgBox "İşletim Sistemi : " & System.Caption & vbNewLine & _
"İşletim Sistemi Versionu :  " & + System.Version & vbNewLine & _
"Windows Mimari Yapısı: " & strOSArch & vbNewLine & _
"Kullanıcı isminiz:  " & objNetwork.UserName & vbNewLine & _
"Bilgisayar ismi: " & strComputerName & vbNewLine & _
"Çalışma Grubu: " & strComputerDomain & vbNewLine & _
"--------------------------------------" & vbNewLine & _
"Anakart: " & MbVendor & " " & "[" & MbModel & "]" & vbNewLine & _
"--------------------------------------" & vbNewLine & _
"Grafik Kartı: " & objItem.Caption & vbNewLine & _
"Driver Version: " & objItem.DriverVersion & vbNewLine & _
"--------------------------------------" & vbNewLine & _
"İşlemci Üreticisi: " & objProcessor.Manufacturer & vbNewLine & _
"İşlemci İsmi: " & objProcessor.Name & vbNewLine & _
"CPU Mimarisi: " & strArchitecture & vbNewLine & _
"İşlemci Çekirdek sayısı: " & oEnv("NUMBER_OF_PROCESSORS") & vbNewLine & _
"--------------------------------------" & vbNewLine & _
"Toplam RAM: " & TotalRam & " MB" & vbNewLine & _
"Toplam Slot: " & totalSlots & vbNewLine & _
"Boş Slot: " & (totalSlots - installedModules) & vbNewLine & _
"Ramlerin bulunduğu slotlar:" & vbcrlf & strMemory,0,"deneme"
Next
Next
Next
Next

please help me , thanks.

Share this post


Link to post
Share on other sites
Jos
13 minutes ago, ufukreis1212 said:

Help me please. I want vbs convert to au3

Ok, so what do you have that isn't working or are you supposed to do it for you?

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
ufukreis1212

I dont know , How convert?

Share this post


Link to post
Share on other sites
FrancescoDiMuro

If I am allowed to reply ( sorry If I'm not )...

@ufukreis1212

Take a look at this ( posted just today ), and Env* functions to "translate" your VBScript to AU3 :)

 


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
ufukreis1212

I cant convert please help me :( 

Share this post


Link to post
Share on other sites
FrancescoDiMuro
Posted (edited)

@ufukreis1212

I think you should read better Forum Etiquette, especially the 1st, 2nd, 3rd, 4th ones, and the note:

Usually asking for a script is not taken too well, within reason. Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.

Edited by FrancescoDiMuro
  • Like 1

Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • QaisBsharat
      By QaisBsharat
      Hello, 
      May i know how can i automation qt application?
      Using controlclick not mouse and positions
       
      Thanks
    • nooneclose
      By nooneclose
      Good afternoon, I am in need of some help. I am sure this is a stupid question requiring only one or two lines of code. However, I would greatly appreciate the help I cannot figure this out. I also tried searching for the answer on the internet but no one except me apparently seems to be having a hard time figuring this out and or is asking about it. 
      I simply want to change the "status" of an email from unread to read once I have processed it. My code is over 500 lines and I would like not to clutter this post with it. Assume I have all my includes and connections properly defined and stuff. 
      Here is the bit of code where I am trying to change the email that was used from unread to read:
      Func ChangeEmailStatus() ;******************************************************************************* ; changes the status of an email from unread to Read ;******************************************************************************* Local $iRows = UBound($aItems, $UBOUND_ROWS) MsgBox("", "Number of Unread emails (Before Change)", $iRows) _OL_ItemModify($oOutlook,$aItems[$i][0], Default, "Read=True") MsgBox("", "Array Display 1", $aItems[1][0]) MsgBox("", "Array Display 2", $aItems[2][0]) Local $iRows = UBound($aItems, $UBOUND_ROWS) MsgBox("", "Number of Unread emails (After Change)", $iRows) EndFunc  
    • SharpDressedMan
      By SharpDressedMan
      Hello,
      Is there any way to check for validity of a pointer to a DllStruct ?
      In the above code, a DllStruct is created from an invalid pointer. How to prevent from doing this ?
      local $tStruct = DllStructCreate("int i") DllStructSetData($tStruct, "i", 123) local $pStruct = DllStructGetPtr($tStruct) $tStruct = 0 ; destroy DllStruct ==> $pStruct becomes invalid ; how to check here for validity of $pStruct and prevent from doing the following ? $tStruct = DllStructCreate("int i", $pStruct) ; create DllStruct from invalid pointer... MsgBox(0, @ScriptName, @error) ; displays '0' : invalid pointer is not detected by DllStructCreate() MsgBox(0, @ScriptName, IsDllStruct($tStruct)) ; displays '1' : tStruct is assumed as a valid DllStruct object, which is not Thanks for help
    • nooneclose
      By nooneclose
      I need to send a string of text to this popup and click on the ok button to save it.
      Here is the code I have so far:
      ;Start IE Sleep(7000) $oIE = _IECreate("http://www.google.com") Sleep(500) _IELoadWait($oIE) $hIE = _IEPropertyGet($oIE, "hwnd") ; Get Handle of the IE window Sleep(500) WinSetState($hIE, "", @SW_MAXIMIZE) ;Wait for a browser page load to complete Sleep(3000) _IENavigate($oIE, "https://properURL.com") Sleep(8000) _IELoadWait($oIE) ;Attach to a browser control embedded in another window $oIE = _IEAttach("https://"properURL.com", url") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $oIE = ' & $oIE & @CRLF & '>Error code: ' & @error & ' Extended code: 0x' & Hex(@extended) & @CRLF) ;### Debug Console Sleep(2000) ;Get the title of the webpage ;Local $wTitle = _IEPropertyGet($oIE, "title") ;MsgBox($MB_SYSTEMMODAL, "Webpage title:", $wTitle) ;Clicks the new button Sleep(3000) _IEAction($nWorkOrderB, "focus") _IEAction($nWorkOrderB, "click") Sleep(5000) ;Store the Element names where the important data will be sent ;Store the long description button Local $wLongDButton = _IEGetObjById($oIE, "m65d795a4-img") ;Store the long Description field id Local $wComments = _IEGetObjById($oIE, "ma6499a9c-rte_iframe") ;Store the ok button id that is in the long description Local $wCommOk = _IEGetObjById($oIE, "m74031266-pb") ;******************************************************************************* ; Send the stored data to the proper field ;******************************************************************************* ;Click the long description button Sleep(300) _IEAction($wLongDButton, "focus") _IEAction($wLongDButton, "click") Sleep(300) ;Sends the Comments Sleep(500) _IEAction($wComments, "focus") _IEAction($wComments, "click") Sleep(500) _IEFormElementSetValue($wComments, "hello darkness my old friend") ;Click the ok button Sleep(500) _IEAction($wCommOk, "focus") _IEAction($wCommOk, "click") Sleep(500)  
      Here is the popup:

    • yasha
      By yasha
      i want am trying to select a nimber to run a program and then select where to save the excel result at before hand
      the problem is that it does not save in the folder i want but the folder before any solutions
      #.................
      $sFolder = ""
          ; Create a constant variable in Local scope of the message to display in FileSelectFolder.
          Local Const $sMessage = "Select a folder"
          ; Display an open dialog to select a file.
          $sFileSelectFolder = FileSelectFolder($sMessage, $sFolder)
          If @error Then
              ; Display the error message.
              MsgBox($MB_SYSTEMMODAL, "", "No folder was selected.")
          Else
              ; Display the selected folder.
              MsgBox($MB_SYSTEMMODAL, "", "You chose the following folder:" & @CRLF & $sFileSelectFolder)
          EndIf
      .......
      ........
      $oExcel = ObjCreate("Excel.Application")                   ; Create an Excel Object
      $oExcel.Visible = 1                                        ; Let Excel show itself
      $oExcel.Workbooks.Open("J:\OPS\OPS_Share\Planners\2 - Weekly Reports\Auto download\"& $YY & $MM & $DD & " ORDER.xls",0)
      $oExcel.ActiveWorkbook.Saveas ( $sFileSelectFolder,""& $YY & $MM & $DD & " ORDER.xlsx", 1)
      $oExcel.ActiveWorkBook.Close
      $oExcel.Quit
      i only want to save it as ddmmyy order inside documents but it saves in libraries as documents ddmmyy order.
×