[Base de registre] Ajouter une imprimante

Ajouter une imprimante [Base de registre] - Divers - Programmation

Marsh Posté le 14-10-2004 à 17:04:26    

Bonjour,
 
Je suis en train de coder un programme et je me heurte à un problème :
Je souhaiterais ajouter une imprimante réseau sur le poste du client sans son intervention. Le poste tourne sous Win98 et tous les drivers sont montés.
 
Mais comment faire maintenant pour l'ajouter ?
J'ai créé un ".reg" qui modifie ma base de registre (voir ci après), j'ajoute 2 ligne dans le WIN.ini mais ca merdouille. J'explique :
1/ Je lance mon prog. Génération du ".reg", application de celui ci et ajout des 2 lignes dans le WIN.ini. Après cela, l'imprimante n'apparait pas dans la liste des imprimantes sous windows.
 
2/ Je reboot le poste. Je vais dans "imprimante" et là, après 2-3 sec, il détect bien mon imprimante réseau mais dans les propriétés, tout est faussé (pas le pilote spécifié dans mon ".reg" par exemple).
 
3/ Je relance le ".reg" que j'avais généré.
 
4/ Je reboot la machine
 
5/ Et là, comme par magie, l'imprimante est là avec les bon paramètres.
 
Questions :  
- Pourquoi windows ne monte-t-il pas l'imprimante lors de la première application du ".reg" ou comment faire pour dire à windows de générer l'imprimante sans rebooter ?
 
- Est ce que quelqu'un a une idée du problème ?
 
Ca m'mmerde un peu, j'ai l'impression d'être tt proche mais je vois mal dire au client de faire ces 5 étapes. Au max, le faire rebooter 1 fois !
 
Fichier ".reg" généré et appliqué :
 
--------------------------------------------
REGEDIT4
 
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Environments\Windows 4.0\Drivers\PrinterDAO]
"Configuration File"="ADOBEPS4.DRV"
"Data File"="ADIST5.PPD"
"Datatype"="RAW"
"Driver"="ADOBEPS4.DRV"
"Help File"="ADOBEPS4.HLP"
"Monitor"=""
"Version"=dword:00350404
"WPX File"="$016ed21.wpx"
"Dependent Files"=hex:43,3a,5c,57,49,4e,44,4f,57,53,5c,53,59,53,54,45,4d,5c,41,\
44,4f,42,45,50,53,34,2e,48,4c,50,00,43,3a,5c,57,49,4e,44,4f,57,53,5c,53,59,\
53,54,45,4d,5c,49,43,4f,4e,4c,49,42,2e,44,4c,4c,00,43,3a,5c,57,49,4e,44,4f,\
57,53,5c,53,59,53,54,45,4d,5c,50,53,4d,4f,4e,2e,44,4c,4c,00,43,3a,5c,57,49,\
4e,44,4f,57,53,5c,53,59,53,54,45,4d,5c,41,44,46,4f,4e,54,53,2e,4d,46,4d,00,\
43,3a,5c,57,49,4e,44,4f,57,53,5c,53,59,53,54,45,4d,5c,41,44,4f,42,45,50,53,\
34,2e,48,4c,50,00,43,3a,5c,57,49,4e,44,4f,57,53,5c,53,59,53,54,45,4d,5c,41,\
44,4f,42,45,50,53,34,2e,44,52,56,00,43,3a,5c,57,49,4e,44,4f,57,53,5c,53,59,\
53,54,45,4d,5c,41,44,49,53,54,35,2e,50,50,44,00,00
[HKEY_LOCAL_MACHINE\Config\0001\System\CurrentControlSet\Control\Print\Printers\PrinterDAO]
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Printers\PrinterDAO]
"Status"=dword:00000000
"Attributes"=dword:00000050
"Datatype"="RAW"
"Default DevMode"=hex:50,72,69,6e,74,65,72,44,41,4f,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,20,04,94,00,ac,06,1f,6f,80,07,\
01,00,09,00,9a,0b,33,08,64,00,01,00,00,01,b0,04,02,00,01,00,b0,04,03,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,08,00,00,00,80,25,00,00,90,33,00,00,00,00,00,\
00,00,00,00,00,02,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,1d,65,71,80,71,80,5a,a8,c7,e7,03,00,02,00,01,00,00,00,00,00,01,\
00,00,00,01,00,02,00,01,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,64,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,07,00,ff,ff,07,00,ff,ff,00,00,ff,ff,00,00,\
ff,ff,04,00,ff,ff,00,00,ff,ff,00,00,ff,ff,00,00,ff,ff,00,00,ff,ff,00,00,ff,\
ff,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,43,75,73,74,6f,6d,20,70,61,67,65,20,30,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,90,42,00,00,90,42,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,43,75,73,74,6f,6d,20,70,61,67,65,20,\
31,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,90,42,00,00,90,42,00,00,00,00,00,00,00,00,00,00,00,00,00,00,43,\
75,73,74,6f,6d,20,70,61,67,65,20,32,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,90,42,00,00,90,42,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,43,75,73,74,6f,6d,20,70,61,67,65,20,33,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,90,42,00,00,90,42,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,18,03,64,02,00,00,00,00,f0,03,64,02,00,00,00,00,f4,\
02,0a,02,00,00,00,00,18,03,c8,04,00,00,00,00,c8,04,18,03,00,00,00,00,75,01,\
d4,01,00,00,00,00,a7,04,4a,03,00,00,00,00,4a,03,53,02,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,01,00,01,00,00,fe,ff,4b,00,00,4c,48,28,29,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,01,00,00,00,00,00,03,00,03,00,00,00,64,00,00,\
00,01,00,01,00,00,00,00,00,00,00,00,00,f0,00,03,00,03,00,00,00,01,00,00,00,\
00,00,00,00,00,00,00,00,00,00,01,00,01,00,00,00,00,00,00,50,43,4d,00,00,00,\  00,00,00,c8,4b,00,00,01,00,00,00,00,00,00,00,01,00,02,00,f6,0d,fe,0d,0e,0e,\
00,00,00,00,00,00,01,00,01,00,00,00
"Description"="Imprimante TEST"
"Name"="PrinterDAO"
"Location"=""
"Parameters"=""
"Port"="\\DAOROUTAGE\PrinterDAO"
"Print Processor"="WinPrint"
"Printer Driver"="PDFCreator"
"Priority"=dword:00000001
"ResidentFontsFile"="C:\\WINDOWS\\AD0CC5E8.MFD"
"Share Name"=""
"Separator File"=""
"UntilTime"=dword:00000000
"StartTime"=dword:00000000
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Printers\PrinterDAO\PrinterDriverData]
[HKEY_CURRENT_CONFIG\System\CurrentControlSet\Control\Print\Printers\PrinterDAO]
 
------------------------------------------
 
Les 2 lignes ajoutés dans le win.ini :
Dans [DEVICES] :
PrinterDAO=ADOBEPS4,\\DAOROUTAGE\PrinterDAO
 
Dans [PrinterPorts] :
PrinterDAO=ADOBEPS4,\\DAOROUTAGE\PrinterDAO,15,45
 
Voilà, si quelqu'un pouvait éclairer mes lanternes.
 
Merci

Reply

Marsh Posté le 14-10-2004 à 17:04:26   

Reply

Marsh Posté le 14-10-2004 à 17:06:16    

je reste calme ...

Reply

Marsh Posté le 14-10-2004 à 17:09:49    

Heu ... qu'est ce que j'ai fait. y'a un truc que j'ai mal fait ?
 
Ouuppss ... :/

Reply

Marsh Posté le 14-10-2004 à 17:16:11    

NoiBe49 a écrit :


Ouuppss ... :/


:sweat:


---------------
Now Playing: {SYNTAX ERROR AT LINE 1210}
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed