Intégrer un script bat avec VB
Bonjour,
J'ai écris un petit script pour me faciliter l'installation d'imprimantes en .bat .
Le voici :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| echo off
set /p ip=Adresse ip du copieur :
set /p pilote=Pilote PCL6 ou PS :
set /p nom=Nom de l'imprimante :
if %PROCESSOR_ARCHITECTURE% == x86 (goto :pilote_x86) else (goto :pilote_x64)
:pilote_x64
if %pilote% == PCL6 (goto :PCL6_64) else (goto :PS_64)
:PCL6_64
set chemin=GPD_64_PCL6\x2UNIVx.inf
goto :script
:PS_64
set chemin=GPD_64_PS\x2UNIVP.inf
goto :script
:pilote_x86
if %pilote% == PCL6 (goto :PCL6_32) else (goto :PS_32)
:PCL6_32
set chemin=GPD_32_PCL6\x2UNIVX.inf
goto :script
:PS_32
set chemin=GPD_32_PS\x2UNIVP.inf
goto :script
:script
cscript %windir%\system32\Printing_Admin_Scripts\fr-FR\prnport.vbs -a -r %ip% -h "%ip%" -o lpr -q lp -md
rundll32.exe printui.dll,PrintUIEntry /if /b "%nom%" /f %chemin% /r %ip% /m "Xerox GPD %pilote% V3.6.433.6.0.0"
goto :eof |
Je ne demande que 3 saisies : une adresse, un nom et le choix entre PCL6 et PS.
Je voudrais rendre l'installation un peu plus convivial pour mes collègues et moi même, et donc je voudrais passer par une interface graphique et j'ai donc pensé à VB.
Le problème est que je ne sais pas comment lier la partie graphique de VB (avec Windows Forms) et le script.
Je parviens a créé une interface qui me conviens, mais je ne sais pas comment mettre en relation les infos que je demande via l'interface et leurs répercutions dans le script.
Quelqu'un pourrait-il me mettre sur la voie?
PS : j'utilise Visual Studio 2015.
D'avance, merci.