I have a script that searches the computer for a specific file and deletes the file called "g2mui.exe". In my case I don't want to delete the file. Instead there may be multiple versions of this file on the computer and that is okay but I need to grab the path of each "g2mui.exe" and then pass variables from the computer and user to the registry. The problem is I don't know how to do this and I don't know how to do this in order to pass the variables into the registry dynamically via capturing the path of each file. I am hoping someone can help. It doesn't need to be a batch script could be powershell, vbs etc..
::Find out what disks are on the system.
for /f "usebackq skip=1 tokens=1" %%a in (`wmic logicaldisk get deviceid`) do (
::Make sure we only use the fixed disks
for /f "usebackq tokens=2 delims=:- " %%x in (`fsutil fsinfo drivetype %%a`) do (
::Is %%a, a fixed disk?
if "%%x" == "Fixed" (
cls
echo - - - - - - - - - - - - - - - - - - - - - - - - -
echo Searching drive %%a
echo - - - - - - - - - - - - - - - - - - - - - - - - -
del /s/f/q %%a\"*g2mui.exe*"
)
)
)
This path may not be correct on all machines, I need the setting applied to each file found on the machine.:
"C:\Users\%username%\AppData\Local\Citrix\GoToMeeting\1350\g2mui.exe" /t REG_SZ /d "HIGHDPIAWARE"
Some machines have this, thats why I need to grab the path and apply the setting to each file found.
"C:\Program Files\1468\g2mui.exe" /t REG_SZ /d "HIGHDPIAWARE"
"C:\Program Files x86\1068\g2mui.exe" /t REG_SZ /d "HIGHDPIAWARE"
Question
brink668
I have a script that searches the computer for a specific file and deletes the file called "g2mui.exe". In my case I don't want to delete the file. Instead there may be multiple versions of this file on the computer and that is okay but I need to grab the path of each "g2mui.exe" and then pass variables from the computer and user to the registry. The problem is I don't know how to do this and I don't know how to do this in order to pass the variables into the registry dynamically via capturing the path of each file. I am hoping someone can help. It doesn't need to be a batch script could be powershell, vbs etc..
Example Registry Key:
This path may not be correct on all machines, I need the setting applied to each file found on the machine.:
Link to comment
Share on other sites
8 answers to this question
Recommended Posts