
bigbangnet
Active Members-
Posts
23 -
Joined
-
Last visited
About bigbangnet
- Birthday 03/11/1979
Profile Information
-
Location
BEHIND YOU
-
Interests
First time I heard about AutoIt was on Hak5. First time scripting in my life so I'm a super noob. No one is "noobier" than me, that's impossible.
bigbangnet's Achievements

Seeker (1/7)
0
Reputation
-
creating a file with printer names
bigbangnet replied to bigbangnet's topic in AutoIt General Help and Support
check...and thanks for the great info -
creating a file with printer names
bigbangnet replied to bigbangnet's topic in AutoIt General Help and Support
So if I understand line 5 says if theres a value in that variable then write something ? I'm trying to understrand so sorry if its sounds stupid. I just looked in the help file and that <> sounds like related to the comparison operators "Tests if two values are not equal." but I can guess it could be "Tests if the first value is less than the second". -
creating a file with printer names
bigbangnet replied to bigbangnet's topic in AutoIt General Help and Support
Nice it works but now I've added @computername Local $printerkey = "" Local $pcname = "" For $i = 1 To 10 $printerkey = RegEnumKey("HKEY_CURRENT_USER\Printers\Connections", $i) FileWriteLine(@ScriptDir & "\printer.txt", @ComputerName & $printerkey ) If @error Then ExitLoop Next Obviously it displays it 10 times. Is there a way to prevent display it 10 times. Only the number of times it gives me a printer name ? I would think of adding a variable to the "FOR" and if the value gives nothing then it would exit the loop..I guess ? -
I'm working in a domain environment and I got some computers to do backups so i thought of doing a script that could take the name of the printers on a file so it would save me some time especially when theres over a 100 computers that I have to do. I want to start small since I'm pretty new to autoit so I thought of this code to start with Local $printerkey = "" For $i = 1 To 10 $printerkey = RegEnumKey("HKEY_CURRENT_USER\Printers\Connections", $i) If @error Then ExitLoop Next $file = FileOpen("printer.txt", 1) FileWrite($file, $printerkey) FileClose($file) It does create a file printer.txt but it writes nothing in it. All I want it to do first is read the regkeys mentionned which should be the printers I go on my pc, then write those which are suppose to be stored in a variable then write them in printers.txt. I know I made a mistake but I don't know where... I guess its the filewrite that doesn't take variables I guess. Sorry for my noobiness
-
Windows User files back up and restore
bigbangnet replied to BrewManNH's topic in AutoIt Example Scripts
Don't mean to do a necro post but I just used this and when trying to compile it it gave me the error "variable used without being declared" on 2 variables on line 28 and line 234. line 27 Else line 28 _MsgBox($MB_ICONexclam, "&OK", "Wrong OS", "This Script only works on Windows XP and up, it can't be used on this version of Windows.", $Timeout, $Pos, $Vpos) line 29 Exit line 232 Func HelpButton1Click() line 233 GUISetState(@SW_HIDE) line 234 $Icon = $MB_ICONINFO So I wonder if my solution should be a good one since I'm a super new scripter. i took those 2 variables and declared them global in the lines in the variables so the new code should look like this : #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile_x64=backup1.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <File.au3> #include <Array.au3> #include <ExtMsgBox.au3> #include <EditConstants.au3> Opt("GUIOnEventMode", 1) Opt("Mustdeclarevars", 1) Opt("GUICloseOnESC", 0) Global $Backup, $Restore, $SavePath, $CopyPath[5], $Search, $LogType, $I Global $X = 0, $NewOS, $UserName1, $Form2, $strPrompt1, $aUserList[10] Global $ArrayItem, $Log, $LogFlag, $LogFile, $LogPath, $UserList[10] Global $Icon, $Button, $Title, $Text, $Timeout, $Pos, $Vpos Global $strSavePath, $Redirect, $NonRedirect, $Loop, $Success = False Global $strLocation, $OK, $strPrompt, $Split, $sUserList[3] Global $MB_ICONexclam Global $MB_ICONINFO If @OSVersion == "WIN_7" Or @OSVersion == "WIN_VISTA" Or @OSVersion = "WIN_2008" Then .... all the other lines goes here When clicking on help NOW it works and doesn't give me this error mentionned earlier and when saving the files from a user to a network folder as well. So did i do well or made a mistake ? -
proper exit when cancel is pressed
bigbangnet replied to bigbangnet's topic in AutoIt General Help and Support
... I feel like an idiot. thanks for the help -
Seem pretty simple enough but I can do it properly. So here is the code first: Local $ordi = InputBox( "VNCViewer - Script", "Entrez votre Addresse Ip ou le nom de hote") Run( "C:\Program Files\UltraVNC\vncviewer.exe" & " " & $ordi & " " & "-password 1111") If @error = 1 Then Exit; exit if cancel pressed What happens: when script is started, I press cancel to exit the script but when I do, vnc pop's up. What I want to happen: when cancel is pressed, it exits the script without opening vnc. Again, any help will be appreciated. Thanks guys
-
Nevermind, I used a variable for filecopy and used it after I verify if my windows is win7 or xp...should of done that before posting here.. sorry
-
I got this code which copies some files in my network to pcs with open office. Really useful if you got lots of pc's. How would I "display" a message that the file was copied successfully ? A bit lost since I use a case here. I know i could call the filecopy in a variable but since I verify if the os is windows 7, xp or 2k thats where I get lost a bit. like this but its not enough since i don't have my os verification going on : $variable = FileCopy ( $CompletePath & "mission" & $NextMis & ".mis", $CompletePath & "currentmis.mis",1 ) If $variable = 1 then ;Do something Else ;Do something else Endif This is my current code Local $os = @OSVersion If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(4, "Vérification de la version de OpenOffice", "Est-ce que la version 3.3 ou supérieur de openOffice est installé ?") Select Case $iMsgBoxAnswer = 6 ;Yes If $os = "WIN_7" Then FileCopy("192.168.1.126clientsappsScriptregistrymodifications.xcu", @AppDataDir & "OpenOffice.org3user", 1) Else If $os = "WIN_XP" Then FileCopy("192.168.1.126clientsappsScriptregistrymodifications.xcu", @AppDataDir & "OpenOffice.org3user", 1) Else If $os = "WIN_2000" Then MsgBox(1, "OpenOffice 3.3", "Ne pas installer ou utiliser Openoffice sur Windows 2000") EndIf EndIf EndIf Case $iMsgBoxAnswer = 7 ;No Exit EndSelect
-
hello guys I'm currently brainstorming for a project that I will work on shortly. But first I just need to know if its possible to include files when I compile my script. This way if a given pc doesn't have that specific file I could use the one in the script. This should help a lot in certain situations. But there's another problem, if thats possible, will there be any problems with "copyright" issues. For example, I was thinking of including lots of network tools and create a simple gui interface with autoscript that way i could use all those network tools in 1 place. Those tools, on top of my head, would be ping(), nslookup, nmap and all those "standard" tools in a network environment would need to work with. In other words if a pc doesn't have nmap or ping.exe for whatever reason, the script will handle it.
-
Displaying a value from a macro
bigbangnet replied to bigbangnet's topic in AutoIt General Help and Support
never mind, I replied too fast. I looked at your last script and modified it to mine and it works correctly now. thanks for your help. and... I love and hate you (I'm jealous lol)...how the *//& you know all that . Seems like you know it by heart. Well continue your awesome work. -
Displaying a value from a macro
bigbangnet replied to bigbangnet's topic in AutoIt General Help and Support
Not quite, If I run that script alone, the first phone number appears then the second number appears. This is not quite what I wanted. I just want the correct number to appear, not the whole list. I have included my complete script so you know what I mean. In short it displays a picture fullscreen, they click the button to quit it, then it sends a silent email (which they don't know of course). I get that email here with the suppose number to call. But the only phone number I get is the first one in my body. #region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Inet.au3> $FrmNouveauPc = GUICreate("Nouveau Pc", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP) GUISetBkColor(0x0066CC) $Pic1 = GUICtrlCreatePic("192.168.1.126clientsappsScriptAutoItImagesCallMIS.jpg", 0, 0, @DesktopWidth, @DesktopHeight) GUICtrlSetState($Pic1, $GUI_DISABLE) $BtnQuitter = GUICtrlCreateButton("Exit / Quitter", @DesktopWidth / 2 - 50, @DesktopHeight / 2 + 200, 100, 50, $BS_CENTER) GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM) GUISetState(@SW_SHOW) Local $iptelephone, $aIP[21] = ["192.168.1.111", "192.168.11.222", "192.168.12.222", "192.168.13.222", "192.168.14.222","192.168.15.222", "192.168.16.222", "192.168.17.222", "192.168.18,222", "192.168.109.222", "192.168.110.222", "192.168.111.222", "192.168.112.222", "192.168.113.222", "192.168.114.222", "192.168.115.222", "192.168.116.222", "192.168.117.222", "192.168.118.222", "192.168.119.222","192.168.120.222"] For $i = 0 To 1 ; Simulate the macro $sIP = $aIP[$i] ; Split the IP on the dots $aSplit = StringSplit($sIP, ".") ; Now look for the 3rd section Switch $aSplit[3] Case "1" $iptelephone = "555-4040" Case "11" $iptelephone = "12121" Case "12" $iptelephone = "000" Case "13" $iptelephone = "999" Case "14" $iptelephone = "888" Case "15" $iptelephone = "777" Case "16" $iptelephone = "111" Case "17" $iptelephone = "222" Case "18" $iptelephone = "222" Case "109" $iptelephone = "333" Case "110" $iptelephone = "444" Case "111" $iptelephone = "555" Case "112" $iptelephone = "666" Case "113" $iptelephone = "6546554" Case "114" $iptelephone = "7654" Case "115" $iptelephone = "5755" Case "116" $iptelephone = "67676" Case "117" $iptelephone = "57669" Case "118" $iptelephone = "6440" Case "119" $iptelephone = "45407" Case "120" $iptelephone = "343430" EndSwitch While 1 Sleep(10) $nMsg = GUIGetMsg() Switch $nMsg Case $BtnQuitter MsgBox(64, "Avertissement", "blah blah. " & Chr(13) & Chr(13) & "blah blah gain") Local $ip = @IPAddress1 Local $pcname = @ComputerName Local $s_SmtpServer = "xxxxx.com" Local $s_FromName = $pcname Local $s_FromAddress = "mail@mail.com" Local $s_ToAddress = "missupport@xxxxx.com" Local $s_Subject = "blah blah" Local $as_Body[3] $as_Body[0] = $pcname $as_Body[1] = $ip $as_Body[2] = "please call " & $iptelephone & " blah blah" Local $Response = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, @ComputerName, -1) Local $err = @error Exit Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd next -
Displaying a value from a macro
bigbangnet replied to bigbangnet's topic in AutoIt General Help and Support
In the first line Local $iptelephone, $aIP[2] = ["192.168.1.111", "192.168.2.222"] what do the last 2 ip address represent ? Are these just 2 examples of ip address. but the important part is the 3rd number in that ip. This means if I have 20 different numbers I would have to type in 20 ip address in my array ? -
hey guys...again, I'm trying to display a phone number which depends on what IP address the pc has. but I'm having trouble with. Seems like the value is not recognised from the macro @IPAddress1. How would I fix this ? In this example, they are suppose to be more IP Address like 192.168.2.0 and so on. So if its 192.168.2.0 its a different number. Local $iptelephone Switch @IPAddress1 Case 192.168.1.0 to 192.168.1.255 $iptelephone = "555-4444" Case 192.168.2.0 to 192.168.2.255 $iptelephone = "555-5555" EndSwitch msgbox(0, Default, $iptelephone )
-
displaying a button on screen
bigbangnet replied to bigbangnet's topic in AutoIt General Help and Support
Ahh I get it, because the $pic was "considered" enable or active (please correct my term if I'm wrong). Now I understand what you did. Thank you so much