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