Guest User

XPS 9320 W10 Webcam Driver Uninstall

a guest
Oct 26th, 2023
1,159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.25 KB | Fixit | 0 0
  1. @echo off
  2.  
  3. :: BatchGotAdmin (Run as Admin code starts)
  4. REM --> Check for permissions
  5. >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
  6. REM --> If error flag set, we do not have admin.
  7. if '%errorlevel%' NEQ '0' (
  8. echo Requesting administrative privileges...
  9. goto UACPrompt
  10. ) else ( goto gotAdmin )
  11. :UACPrompt
  12. echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
  13. echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
  14. "%temp%\getadmin.vbs"
  15. exit /B
  16. :gotAdmin
  17. if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
  18. pushd "%CD%"
  19. CD /D "%~dp0"
  20. :: BatchGotAdmin (Run as Admin code ends)
  21. :: Your codes should start from the following line
  22.  
  23. rem Setting all UWD inf names
  24. set substring_1=iacamera64.inf
  25. set substring_2=iactrllogic64.inf
  26. set substring_3=iaisp64.inf
  27. set substring_4=hm1092.inf
  28. set substring_5=hm2170.inf
  29. set substring_6=ov02c10.inf
  30. set substring_7=ov01a.inf
  31. set substring_8=ov01a1b.inf
  32. set substring_9=iacamera64_extension_dell_mayabay.inf
  33. set substring_10=iacamera64_extension_dell_mayabay_vpu.inf
  34. set substring_11=iacamera64_extension_dell_teton.inf
  35. set substring_12=iacamera64_extension_dell_teton_vpu.inf
  36. set substring_13=iacamera64_iacamera64_extension_dell_oasis.inf
  37. set substring_14=iacamera64_extension_dell_xps.inf
  38. set substring_15=iacamera64_extension_dell_consumer.inf
  39. set substring_16=usbspi.inf
  40. set substring_17=usbi2c.inf
  41. set substring_18=usbgpio.inf
  42. set substring_19=cvfusbdfuextension.inf
  43. set substring_20=cvfusbdfu.inf
  44. set substring_21=cvfusbbridgeextension.inf
  45. set substring_22=cvfusbbridge.inf
  46. set substring_23=ishheci.inf
  47. set substring_24=spioed.inf
  48. set substring_25=ivsc.inf
  49.  
  50. set counter1=0
  51. set counter2=0
  52. set counter3=0
  53. set counter4=0
  54. set counter5=0
  55. set counter6=0
  56. set counter7=0
  57. set counter8=0
  58. set counter9=0
  59. set counter10=0
  60. set counter11=0
  61. set counter12=0
  62. set counter13=0
  63. set counter14=0
  64. set counter15=0
  65. set counter16=0
  66. set counter17=0
  67. set counter18=0
  68. set counter19=0
  69. set counter20=0
  70. set counter21=0
  71. set counter22=0
  72. set counter23=0
  73. set counter24=0
  74. set counter25=0
  75.  
  76. set prev_line=""
  77.  
  78. echo ****** Searching and removing original camera drivers... ******
  79. echo.
  80. pnputil /enum-drivers > drivers.txt
  81.  
  82. set "File2Read=drivers.txt"
  83. If Not Exist "%File2Read%" (Goto :Error)
  84.  
  85. rem This will read a file into an array of variables and populate it
  86. setlocal EnableExtensions EnableDelayedExpansion
  87. for /f "delims=" %%a in ('Type "%File2Read%"') do (
  88. set /a count+=1
  89. set "Line[!count!]=%%a"
  90. )
  91.  
  92. For /L %%i in (1,1,%Count%) do (
  93. echo "!Line[%%i]!" | findstr /C:"!substring_1!" 1>nul
  94. if errorlevel 1 (
  95. rem pattern not found
  96. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  97. ) ELSE (
  98. rem got zero found pattern
  99. call :getOemNum "!Line[%%i]!" "!prev_line!"
  100. set /a counter1+=1
  101. )
  102.  
  103. echo "!Line[%%i]!" | findstr /C:"!substring_2!" 1>nul
  104. if errorlevel 1 (
  105. rem pattern not found
  106. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  107. ) ELSE (
  108. rem got zero found pattern
  109. call :getOemNum "!Line[%%i]!" "!prev_line!"
  110. set /a counter2+=1
  111. )
  112.  
  113. echo "!Line[%%i]!" | findstr /C:"!substring_3!" 1>nul
  114. if errorlevel 1 (
  115. rem pattern not found
  116. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  117. ) ELSE (
  118. rem got zero found pattern
  119. call :getOemNum "!Line[%%i]!" "!prev_line!"
  120. set /a counter3+=1
  121. )
  122.  
  123. echo "!Line[%%i]!" | findstr /C:"!substring_4!" 1>nul
  124. if errorlevel 1 (
  125. rem pattern not found
  126. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  127. ) ELSE (
  128. rem got zero found pattern
  129. call :getOemNum "!Line[%%i]!" "!prev_line!"
  130. set /a counter4+=1
  131. )
  132.  
  133. echo "!Line[%%i]!" | findstr /C:"!substring_5!" 1>nul
  134. if errorlevel 1 (
  135. rem pattern not found
  136. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  137. ) ELSE (
  138. rem got zero found pattern
  139. call :getOemNum "!Line[%%i]!" "!prev_line!"
  140. set /a counter5+=1
  141. )
  142.  
  143. echo "!Line[%%i]!" | findstr /C:"!substring_6!" 1>nul
  144. if errorlevel 1 (
  145. rem pattern not found
  146. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  147. ) ELSE (
  148. rem got zero found pattern
  149. call :getOemNum "!Line[%%i]!" "!prev_line!"
  150. set /a counter6+=1
  151. )
  152.  
  153. echo "!Line[%%i]!" | findstr /C:"!substring_7!" 1>nul
  154. if errorlevel 1 (
  155. rem pattern not found
  156. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  157. ) ELSE (
  158. rem got zero found pattern
  159. call :getOemNum "!Line[%%i]!" "!prev_line!"
  160. set /a counter7+=1
  161. )
  162.  
  163. echo "!Line[%%i]!" | findstr /C:"!substring_8!" 1>nul
  164. if errorlevel 1 (
  165. rem pattern not found
  166. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  167. ) ELSE (
  168. rem got zero found pattern
  169. call :getOemNum "!Line[%%i]!" "!prev_line!"
  170. set /a counter8+=1
  171. )
  172.  
  173. echo "!Line[%%i]!" | findstr /C:"!substring_9!" 1>nul
  174. if errorlevel 1 (
  175. rem pattern not found
  176. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  177. ) ELSE (
  178. rem got zero found pattern
  179. call :getOemNum "!Line[%%i]!" "!prev_line!"
  180. set /a counter9+=1
  181. )
  182.  
  183. echo "!Line[%%i]!" | findstr /C:"!substring_10!" 1>nul
  184. if errorlevel 1 (
  185. rem pattern not found
  186. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  187. ) ELSE (
  188. rem got zero found pattern
  189. call :getOemNum "!Line[%%i]!" "!prev_line!"
  190. set /a counter10+=1
  191. )
  192.  
  193. echo "!Line[%%i]!" | findstr /C:"!substring_11!" 1>nul
  194. if errorlevel 1 (
  195. rem pattern not found
  196. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  197. ) ELSE (
  198. rem got zero found pattern
  199. call :getOemNum "!Line[%%i]!" "!prev_line!"
  200. set /a counter11+=1
  201. )
  202.  
  203. echo "!Line[%%i]!" | findstr /C:"!substring_12!" 1>nul
  204. if errorlevel 1 (
  205. rem pattern not found
  206. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  207. ) ELSE (
  208. rem got zero found pattern
  209. call :getOemNum "!Line[%%i]!" "!prev_line!"
  210. set /a counter12+=1
  211. )
  212.  
  213. echo "!Line[%%i]!" | findstr /C:"!substring_13!" 1>nul
  214. if errorlevel 1 (
  215. rem pattern not found
  216. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  217. ) ELSE (
  218. rem got zero found pattern
  219. call :getOemNum "!Line[%%i]!" "!prev_line!"
  220. set /a counter13+=1
  221. )
  222.  
  223. echo "!Line[%%i]!" | findstr /C:"!substring_14!" 1>nul
  224. if errorlevel 1 (
  225. rem pattern not found
  226. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  227. ) ELSE (
  228. rem got zero found pattern
  229. call :getOemNum "!Line[%%i]!" "!prev_line!"
  230. set /a counter14+=1
  231. )
  232.  
  233. echo "!Line[%%i]!" | findstr /C:"!substring_15!" 1>nul
  234. if errorlevel 1 (
  235. rem pattern not found
  236. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  237. ) ELSE (
  238. rem got zero found pattern
  239. call :getOemNum "!Line[%%i]!" "!prev_line!"
  240. set /a counter15+=1
  241. )
  242.  
  243. echo "!Line[%%i]!" | findstr /C:"!substring_16!" 1>nul
  244. if errorlevel 1 (
  245. rem pattern not found
  246. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  247. ) ELSE (
  248. rem got zero found pattern
  249. call :getOemNum "!Line[%%i]!" "!prev_line!"
  250. set /a counter16+=1
  251. )
  252.  
  253. echo "!Line[%%i]!" | findstr /C:"!substring_17!" 1>nul
  254. if errorlevel 1 (
  255. rem pattern not found
  256. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  257. ) ELSE (
  258. rem got zero found pattern
  259. call :getOemNum "!Line[%%i]!" "!prev_line!"
  260. set /a counter17+=1
  261. )
  262.  
  263. echo "!Line[%%i]!" | findstr /C:"!substring_18!" 1>nul
  264. if errorlevel 1 (
  265. rem pattern not found
  266. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  267. ) ELSE (
  268. rem got zero found pattern
  269. call :getOemNum "!Line[%%i]!" "!prev_line!"
  270. set /a counter18+=1
  271. )
  272.  
  273. echo "!Line[%%i]!" | findstr /C:"!substring_19!" 1>nul
  274. if errorlevel 1 (
  275. rem pattern not found
  276. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  277. ) ELSE (
  278. rem got zero found pattern
  279. call :getOemNum "!Line[%%i]!" "!prev_line!"
  280. set /a counter19+=1
  281. )
  282.  
  283. echo "!Line[%%i]!" | findstr /C:"!substring_20!" 1>nul
  284. if errorlevel 1 (
  285. rem pattern not found
  286. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  287. ) ELSE (
  288. rem got zero found pattern
  289. call :getOemNum "!Line[%%i]!" "!prev_line!"
  290. set /a counter20+=1
  291. )
  292.  
  293. echo "!Line[%%i]!" | findstr /C:"!substring_21!" 1>nul
  294. if errorlevel 1 (
  295. rem pattern not found
  296. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  297. ) ELSE (
  298. rem got zero found pattern
  299. call :getOemNum "!Line[%%i]!" "!prev_line!"
  300. set /a counter21+=1
  301. )
  302.  
  303. echo "!Line[%%i]!" | findstr /C:"!substring_22!" 1>nul
  304. if errorlevel 1 (
  305. rem pattern not found
  306. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  307. ) ELSE (
  308. rem got zero found pattern
  309. call :getOemNum "!Line[%%i]!" "!prev_line!"
  310. set /a counter22+=1
  311. )
  312.  
  313. echo "!Line[%%i]!" | findstr /C:"!substring_23!" 1>nul
  314. if errorlevel 1 (
  315. rem pattern not found
  316. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  317. ) ELSE (
  318. rem got zero found pattern
  319. call :getOemNum "!Line[%%i]!" "!prev_line!"
  320. set /a counter23+=1
  321. )
  322.  
  323. echo "!Line[%%i]!" | findstr /C:"!substring_24!" 1>nul
  324. if errorlevel 1 (
  325. rem pattern not found
  326. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  327. ) ELSE (
  328. rem got zero found pattern
  329. call :getOemNum "!Line[%%i]!" "!prev_line!"
  330. set /a counter24+=1
  331. )
  332.  
  333. echo "!Line[%%i]!" | findstr /C:"!substring_25!" 1>nul
  334. if errorlevel 1 (
  335. rem pattern not found
  336. rem echo "did not find "!substring_1!" in !Line[%%i]!"
  337. ) ELSE (
  338. rem got zero found pattern
  339. call :getOemNum "!Line[%%i]!" "!prev_line!"
  340. set /a counter25+=1
  341. )
  342.  
  343. set "prev_line=!Line[%%i]!"
  344. )
  345.  
  346. echo "%substring_1% found and removed: %counter1% times"
  347. echo "%substring_2% found and removed: %counter2% times"
  348. echo "%substring_3% found and removed: %counter3% times"
  349. echo "%substring_4% found and removed: %counter4% times"
  350. echo "%substring_5% found and removed: %counter5% times"
  351. echo "%substring_6% found and removed: %counter6% times"
  352. echo "%substring_7% found and removed: %counter7% times"
  353. echo "%substring_8% found and removed: %counter8% times"
  354. echo "%substring_9% found and removed: %counter9% times"
  355. echo "%substring_10% found and removed: %counter10% times"
  356. echo "%substring_11% found and removed: %counter11% times"
  357. echo "%substring_12% found and removed: %counter12% times"
  358. echo "%substring_13% found and removed: %counter13% times"
  359. echo "%substring_14% found and removed: %counter14% times"
  360. echo "%substring_15% found and removed: %counter15% times"
  361. echo "%substring_16% found and removed: %counter16% times"
  362. echo "%substring_17% found and removed: %counter17% times"
  363. echo "%substring_18% found and removed: %counter18% times"
  364. echo "%substring_19% found and removed: %counter19% times"
  365. echo "%substring_20% found and removed: %counter20% times"
  366. echo "%substring_21% found and removed: %counter21% times"
  367. echo "%substring_22% found and removed: %counter22% times"
  368. echo "%substring_23% found and removed: %counter23% times"
  369. echo "%substring_24% found and removed: %counter24% times"
  370. echo "%substring_25% found and removed: %counter25% times"
  371. del drivers.txt /Q
  372.  
  373. echo.
  374. echo ****** Driver uninstall complete ******
  375. echo.
  376. pause
  377. exit /b 0
  378.  
  379. :getOemNum
  380. rem echo "proccesing %1, searching for %~2"
  381. for /F "tokens=2 delims=:" %%a in ("%~2%") do (
  382. call :deleteOEM %%a
  383. )
  384. exit /b
  385.  
  386. :deleteOEM
  387. set strDelete="remove %1"
  388. echo %strDelete%
  389. pnputil /delete-driver %1 /force /uninstall
  390. exit /b
  391.  
  392. :ERROR
  393. ECHO Uninstall failed, refer to logFile.
  394. echo The file "%File2Read%" does not exist !
  395. exit /b 1
Tags: XPS
Advertisement
Add Comment
Please, Sign In to add comment