# Problem script Win7 x64

## Recommended Posts

Hi,

I am a noob in scripting but i likthat and i have a problem with my script which is the txt file generated by my script command "ipconfig /all" has many bad characters.

The "é" have benn replaced by a "," and there is others bug as that.

I don't understand why because my script works perfectly in Windows XP.

exemple generated file :

Configuration IP de Windows

Nom de l'h“te . . . . . . . . . . :

Suffixe DNS principal . . . . . . :

Type de noeud. . . . . . . . . . :

Routage IP activ‚ . . . . . . . . :

Proxy WINS activ‚ . . . . . . . . :

Carte Ethernet Connexion au r‚seau local :

Suffixe DNS propre … la connexion. . . :

Description. . . . . . . . . . . . . . :

Adresse physique . . . . . . . . . . . :

DHCP activ‚. . . . . . . . . . . . . . :

Configuration automatique activ‚e. . . :

Adresse IPv6 de liaison locale. . . . .:

Adresse IPv4. . . . . . . . . . . . . .:

Masque de sous-r‚seau. . . .ÿ. . . . . :

Bail obtenu. . . . . . . . .ÿ. . . . . :

Bail expirant. . . . . . . . .ÿ. . . . :

Passerelle par d‚faut. . . .ÿ. . . . . :

Serveur DHCP . . . . . . . . . . . . . :

IAID DHCPv6 . . . . . . . . . . . :

DUID de client DHCPv6. . . . . . . . :

Serveurs DNS. . . . . . . . . . . . . :

NetBIOS sur Tcpip. . . . . . . . . . . :

Look the "ÿ" !!!

This is my script code :

```#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\scripts\Form1.kxf
Global \$Form1 = GUICreate("IPView v1.0", 633, 438, -1, -1)
Global \$Button1 = GUICtrlCreateButton("Lancer", 276, 376, 81, 33, \$WS_GROUP)
Global \$Pic1 = GUICtrlCreatePic("C:\scripts\testimg.bmp", 0, 0, 633, 65, BitOR(\$SS_NOTIFY,\$WS_GROUP,\$WS_CLIPSIBLINGS))
Global \$Text = GUICtrlCreateEdit("", 104, 80, 433, 281)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

\$fichier = @WindowsDir

While 1
\$nMsg = GUIGetMsg()
Switch \$nMsg
Case \$GUI_EVENT_CLOSE
Fin()
Case \$Button1
RunWait(@ComSpec & " /c ipconfig /all > " & "c:\WINDOWS\ipconfig.txt", "", @SW_HIDE)
Case \$Quitteritem
Fin()
Case \$Apropositem
MsgBox(64, "A Propos", "IPView v1.0" & @CRLF & "Développé par : Antoine Martin" & @CRLF & "Companie : TonioSoftware ©" & @CRLF & @CRLF & "Uniquement compatible Windows XP")
Case \$Couperitem
Send("{CTRLDOWN}")
Send("x")
Send("{CTRLUP}")
Case \$Copieritem
Send("{CTRLDOWN}")
Send("c")
Send("{CTRLUP}")
Case \$Colleritem
Send("{CTRLDOWN}")
Send("v")
Send("{CTRLUP}")
Case \$Effaceritem
Send("{DELETE}")

EndSwitch
WEnd

Func Fin()

SplashTextOn("", "Fermeture du programme en cours,  Veuillez patienter ...", 450, 70, -1, -1, 0 + 1 + 16 + 32, "Times New Roman", 12, 800)
Sleep(2000)
SplashOff()
Exit
EndFunc```

thanks to help me .

##### Share on other sites

I don't understand why because my script works perfectly in Windows XP.

As far as I understood your script, you just wanted to have the IPCONFIG output in a text filed. And then the content of this filed could be copied, removed or cutted (including just delete).

So I changed your script a little.

You wrote that the script only works in XP, so I guess Vista or WIn7 is the problme. Maybe this is related to "c:\WINDOWS\ipconfig.txt"

Normaly you are not allowed to write to windows dir in Win7/Vista without Adminrights. So the file IPCONFIG.TXT will not be created. But on the other hand you wrote it looks very strange. Please add the file as a download or paste it in the code section so I may see the real file .

Maybe you want to try my version? I also removed the strange Key Send sequence.

```#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\scripts\Form1.kxf
Global \$Form1 = GUICreate("IPView v1.0", 633, 438, -1, -1)
Global \$Button1 = GUICtrlCreateButton("Lancer", 276, 376, 81, 33, \$WS_GROUP)
Global \$Pic1 = GUICtrlCreatePic("C:\scripts\testimg.bmp", 0, 0, 633, 65, BitOR(\$SS_NOTIFY, \$WS_GROUP, \$WS_CLIPSIBLINGS))
Global \$Text = GUICtrlCreateEdit("", 104, 80, 433, 281)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

\$fichier = @WindowsDir

While 1
\$nMsg = GUIGetMsg()
Switch \$nMsg
Case \$GUI_EVENT_CLOSE
Fin()
Case \$Button1

\$ShellCommand = "ipconfig /all"
\$Workdir = @ScriptDir
\$foo = Run(@ComSpec & " /c " & \$ShellCommand, \$Workdir, @SW_HIDE, 2 + 4)
Sleep(1000)
Local \$line
While 1
If @error Then ExitLoop
GUICtrlSetData(\$Text, \$line)
WEnd

While 1
If @error Then ExitLoop
GUICtrlSetData(\$Text, \$line)
WEnd

Case \$Quitteritem
Fin()
Case \$Apropositem
MsgBox(64, "A Propos", "IPView v1.0" & @CRLF & "Développé par : Antoine Martin" & @CRLF & "Companie : TonioSoftware ©" & @CRLF & @CRLF & "Uniquement compatible Windows XP")
Case \$Couperitem
guictrlsetdata(\$Text,"")
Case \$Copieritem
Case \$Colleritem
guictrlsetdata(\$Text,clipget())
Case \$Effaceritem
guictrlsetdata(\$Text,"")

EndSwitch
WEnd

Func Fin()

SplashTextOn("", "Fermeture du programme en cours,  Veuillez patienter ...", 450, 70, -1, -1, 0 + 1 + 16 + 32, "Times New Roman", 12, 800)
Sleep(2000)
SplashOff()
Exit
EndFunc   ;==>Fin```

## Create an account

Register a new account