Problem executing snapin script
-
Hi,
I’m looking to deploy a device driver on a Windows 10 machine using a Snapin Pack.
I’ve created a .zip file containing the necessary files + an install.bat batch script.
The problem I’m encountering is that the script executes correctly according to FOG (return code 0), but some lines of the script (the most important ones in fact) are simply not executed.
I’ve extended the script to save the command execution output in a file (c:\tmp\usb-blaster-install.txt) so that I can understand where the problem lies.
install.bat :
rmdir /S /Q c:\tmp mkdir c:\tmp echo "start" 1> c:\tmp\usb-blaster-install.txt 2>&1 echo %cd% 1>> c:\tmp\usb-blaster-install.txt 2>&1 where pnputil 1>> c:\tmp\usb-blaster-install.txt 2>&1 pnputil 1>> c:\tmp\usb-blaster-install.txt 2>&1 C:\Windows\System32\pnputil.exe /add-driver usbblstr.inf /subdirs /install 1>> c:\tmp\usb-blaster-install.txt 2>&1 where python 1>> c:\tmp\usb-blaster-install.txt 2>&1 python -V 1>> c:\tmp\usb-blaster-install.txt 2>&1 echo "end" 1>> c:\tmp\usb-blaster-install.txt 2>&1
For some reason, lines 7, 8 and 9 containing the pnputil command are not executed.
The pnputil command is present on the system, and the script runs when I copy it and run it locally, but not via the FOG agent.Here’s the content of my output file when I run it via fog, it contains some strange characters :
"start" C:\Program Files (x86)\FOG\tmp\drivers-usb-blaster Informationÿ: impossible de trouver des fichiers pour le(s) modle(s) spcifi(s). 'pnputil' n'est pas reconnu en tant que commande interne ou externe, un programme excutable ou un fichier de commandes. 'C:\Windows\System32\pnputil.exe' n'est pas reconnu en tant que commande interne ou externe, un programme excutable ou un fichier de commandes. C:\ProgramData\anaconda3\python.exe Python 3.10.9 "end"
As I said above, when I run it locally the script executes well and the output file contains the expected commands, and no weird characters.
I’m not sure what the problem could be, as if the terminal launched by fog were running with a particular encoding.
If you have an idea in mind, please let me know.Julien