Sign in to follow this  
Followers 0
realkiller

replace text in registry file

6 posts in this topic

#1 ·  Posted (edited)

i wanna replace the word imagecomputername with @computername.

i tryed this but then i get a emty file

#include <File.au3>

_ReplaceStringInFile("1.reg", "imagecomputername", @ComputerName)

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Printers]

"DeviceOld"="FreePDF XP,winspool,Ne01:"

[HKEY_CURRENT_USER\Printers\Connections]

[HKEY_CURRENT_USER\Printers\DevModePerUser]

"100-PW infotec IS 2215 PCL 6"=hex:31,00,30,00,30,00,2d,00,50,00,57,00,20,00,\

69,00,6e,00,66,00,6f,00,74,00,65,00,63,00,20,00,20,00,49,00,53,00,20,00,32,\

00,32,00,31,00,35,00,20,00,50,00,43,00,4c,00,20,00,36,00,00,00,00,00,00,00,\

01,04,00,01,dc,00,dc,08,03,ff,00,04,01,00,09,00,dc,05,84,03,64,00,01,00,07,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,b8,09,00,00,9d,0f,00,\

00,c0,0d,00,00,01,00,00,00,b8,09,00,00,71,0c,00,00,00,00,00,00,04,00,00,00,\

84,03,00,00,dc,05,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,05,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,18,00,00,00,00,00,10,27,10,27,10,27,00,\

00,10,27,00,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00

[HKEY_CURRENT_USER\Printers\Settings]

[HKEY_CURRENT_USER\Printers\Settings\Wizard]

"Default Attributes"=dword:00000200

"Test Page"=dword:00000000

"From Web"=dword:00000000

"Use Existing"=dword:00000000

"Set As Default"=dword:00000000

"Driver Name"="Generic / Text Only"

"Local Printer"=dword:00000000

"Shared"=dword:00000000

"Additional Drivers"=dword:00000001

"PnP Autodetect"=dword:00000000

"Wireless"=dword:00000000

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts]

"uNCName"="\\\\imagecomputername\\100-AV Kyocera Mita FS-6020 KX"

"FreePDF XP"="winspool,Ne01:,15,45"

"103-kde Kyocera Mita FS-3820N KX"="winspool,Ne02:,15,45"

"103-icm Kyocera Mita FS-1800+ KX"="winspool,Ne03:,15,45"

"103-gf infotec IS 2230 PCL 6"="winspool,Ne04:,15,45"

"103-eg Kyocera FS-6900 KX"="winspool,Ne05:,15,45"

"102-gl nfotec IS 2135 PCL 6"="winspool,Ne06:,15,45"

"102-at Kyocera FS-9000 KX"="winspool,Ne07:,15,45"

"101-np Kyocera Mita KM-2030 KX"="winspool,Ne08:,15,45"

"101-ni Kyocera Mita KM-2530 KX"="winspool,Ne09:,15,45"

"101-NI Kyocera FS-9000 KX"="winspool,Ne10:,15,45"

"101-kr Kyocera Mita FS-9100DN KX"="winspool,Ne11:,15,45"

"101-gf Canon iR2200-3300 PCL5e"="winspool,Ne12:,15,45"

"101-FB Kyocera FS-7000+ KX"="winspool,Ne13:,15,45"

"100-ZT Kyocera Mita KM-3530 KX"="winspool,Ne14:,15,45"

"100-qm infotec IS 2215 PCL 6"="winspool,Ne16:,15,45"

"100-PW infotec IS 2215 PCL 6"="winspool,Ne17:,15,45"

"100-pak Kyocera Mita FS-9120DN KX"="winspool,Ne18:,15,45"

"100-l2 Kyocera Mita FS-1800+ KX"="winspool,Ne19:,15,45"

"100-l1 infotec IS 2018 PCL 6"="winspool,Ne20:,15,45"

"100-AV Kyocera Mita FS-6020 KX"="winspool,Ne21:,15,45"

"100-VS Kyocera Mita FS-1920 KX"="winspool,Ne15:,15,45"

"Generic / Text Only"="winspool,LPT1:,15,45"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers]

"DefaultSpoolDirectory"="C:\\WINDOWS\\System32\\spool\\PRINTERS"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\100-AV Kyocera Mita FS-6020 KX]

"ChangeID"=dword:00549f25

"Status"=dword:00000080

"Name"="100-AV Kyocera Mita FS-6020 KX"

"Share Name"=""

"Print Processor"="WinPrint"

"Datatype"="RAW"

"Parameters"=""

"Action"=dword:00000000

"ObjectGUID"=""

"DsKeyUpdate"=dword:00000000

"DsKeyUpdateForeground"=dword:00000000

"Description"=""

"Printer Driver"="Kyocera Mita FS-6020 KX"

Edited by realkiller

Share this post


Link to post
Share on other sites



That's a ridiculous post! I won't even read it... it's so long.

Use [ CodeBox][ Quote]Your Long Ass Stuff Here[ /Quote][ /CodeBox] (without spaces)


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

sorry i posted it without knowing it

Your example doesn't even have the word imagecomputername in it.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

srry i had to delete hole text i added the text

realkiller: Do you have the .reg file in the same folder as your script? I just copied your post into a .reg file, ran your code, and it worked just fine. If no path is specified, it searches for the 1.reg file in the same directory that your script is running from.

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
Sign in to follow this  
Followers 0