Jump to content

Driss

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by Driss

  1. Thank you Larry, bew ver did it Thank you ezzetabi for the lengthy script, realy appreciate it Thank you all for the help. Once again you guys saved me a lots of sweat. Driss
  2. Hi, Thanks for taking time to put this lengthy script together for me, but I am getting Error of Incorrect number of parameter infunction call in line 28. any input Thanks again Driss
  3. hi again, I had this script from a while back, and I used it to change printers ip addresses from a logon script, and I thouth I could use same method to change my xml files. I looked at the help file and searched this forum for example, but Still no clue. Can you please help with an example of how to use filefindfirst and filefindnext with I am trying to do. Yes all xml files have same ip address that needs to change to the new ip. Thank you guys Driss
  4. Hi, Once again, I need your help. I would like to know how to StringReplace all my xml files in folder1 to folder2. I have a code that works with a single file, I need this for all my xml files 100s of them, the example bellow works fine with a single file. Dim $INFILEHANDLE, $OUTFILEHANDLE Dim $DATA, $INFILE, $OUTFILE $INFILE = "W:\web\old_xml_folder\file1.xml" $OUTFILE = "W:\web\new_xml_folder\file1.xml" $INFILEHANDLE = FileOpen($INFILE, 0) $DATA = FileRead($INFILEHANDLE,FileGetSize($INFILE)) $DATA = StringReplace($DATA, "192.168.2.3", "172.16.1.3") $OUTFILEHANDLE = FileOpen($OUTFILE,2) FileWrite($OUTFILEHANDLE, $DATA) FileClose($INFILE) FileClose($OUTFILEHANDLE) Thanks in advance Driss
  5. Yes it was the space, it worked perfectly Thanks a lot Dan Cheers
  6. Hi again, When I export the key using regedit /e the file is exported in a unicode and the new file is created, but it's empty. When I export the file using regedit /a the file is exported as an ANSI, the new file is created with same content, but nothing is replaced. Am I doing something wrong? Thanks
  7. More help needed, Ok. I exported the registry ports key, but was unsuccessful getting String Replace to work for me. I have searched the help file, this forum, and the Internet before posting here and was not successful replacing a single word in the .reg file Example: I am trying to search for 172.16.1.24 only if found then replace it with 10.10.10.27 I also need NOT to change the key "IP_172.16.1.24" because it is a key and it will write a whole new key under ports and not replace it after I import it. From c:\printerreg.reg [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Print\Monitors\Standard TCP/IP Port\Ports\IP_172.16.1.24] "Protocol"=dword:00000001 "Version"=dword:00000001 "HostName"="" "IPAddress"= "172.16.1.24" "HWAddress"="" "PortNumber"=dword:0000238c "SNMP Community"="public" "SNMP Enabled"=dword:00000001 "SNMP Index"=dword:00000001 I have a long autoit ver 2 script that does a lots of basic functions and they all work perfectly, So any help that I can add to it since it's not ver 3 would be appreciated, but at this point I can use any help I can get. Thanks
  8. Thanks Larry, I knew it will come down to export replace and import. I will give it a try Thanks agin Driss
  9. Thanks ZenKensei for the tip I can change the IP manualy from the registry, and all works fine, but I need to do this from the logon script, the registry keys differ on all machines, I also don't know what printers are Installed where, I just want to be able to search for ip under print hive and simply replace it with the corresponding new IP, I have the ip addresses of all printers, we will be replacing the printers IP addresses as an example 172.16.1.40 to 10.10.10.40 172.16.1.43 to 10.10.10.41 172.16.1.45 to 10.10.10.70 172.16.1.20 to 10.10.10.99 So the machines old ip will need to be replaced as well. bellow is a reg key from one machine [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Monitors\HP JetDirect Port\Ports\NPI8C3491] "NetworkProtocol"=dword:00000002 "PortNumber"=dword:00000000 "HPNetworkPrinterID"="TCPIP,172.16.1.42,0" "HWAddress"=hex:00,01,e6,8c,34,91 [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Monitors\HP JetDirect Port\Ports\NPI4FD688] "NetworkProtocol"=dword:00000002 "PortNumber"=dword:00000000 "HPNetworkPrinterID"="TCPIP,172.16.1.44,0" "HWAddress"=hex:00,01,e6,4f,d6,88 if this cannot be done using Autoit what would be the best approch. Thank you all Driss
  10. Tomorrow I will post reg entries of 2 or 3 win 98 machines with different printers so you can see how they differ. Thanks again Driss
  11. Hi Larry, See the thing is each win98 machine has 2 or up to 4 different printers installed all through a TCP/IP local port, and I don't know which printers are Installed where. I just have the IP addresses of the 20 or so printers, so I was thinking may be there could be something like If registry Exist, 68.76.x.x then replace with 172.16.x.x I hope I clearified it better Thank you
  12. Hi, We have about 100 windows 98 boxes, each box has a different printers Installed with a TCP/IP local port and comunicate straight to the printer through its static IP. We want to change the IP addresses of these printers and run script on win98 to search the registry for the old IPs and replace them with the new ones. Can search and replace registry values be done with Autoit? if so can any one please shad some light. Thank you Drisco
  13. Hi Tim, Try this. copy paste to text editor and name it something.vbs Dim WSHShell, NList, N, IPAddress, IPMask, DefaultGateway, IPValue, RegLoc Set WSHShell = WScript.CreateObject("WScript.Shell") RegTCP = "HKLM\System\CurrentControlSet\Services\VxD\MSTCP\" Domain = RegTCP & N & "\Domain" EnableDNS = RegTCP & N & "\EnableDNS" HostName = RegTCP & N & "\HostName" NameServer = RegTCP & N & "\NameServer" WSHShell.RegWrite Domain,"" WSHShell.RegWrite EnableDNS,"0" WSHShell.RegWrite HostName,"" WSHShell.RegWrite NameServer,"" NList = array("0000","0001","0002","0003","0004","0005","0006", _ "0007","0008","0009","0010") On Error Resume Next RegLoc = "HKLM\System\CurrentControlSet\Services\Class\NetTrans\" For Each N In NList IPValue = "" 'Resets variable IPAddress = RegLoc & N & "\IPAddress" IPMask = RegLoc & N & "\IPMask" DefaultGateway = RegLoc & N & "\DefaultGateway" IPValue = WSHShell.RegRead(IPAddress) If (IPValue <> "") and (IPValue <> "0.0.0.0") then WSHShell.RegWrite IPAddress,"0.0.0.0" WSHShell.RegWrite IPMASK,"0.0.0.0" WSHShell.RegWrite DefaultGateway,"" end If Next WScript.Quit ' Tells the script to stop and exit. Good luck Driss
×
×
  • Create New...