Originally Posted by
Supersniper98
If the user has a space in his name (example 2 or more words) the script will just take the 1st word and ignores the rest (after the space), and therefore it doesn't do anything... I tried that on another computer and that is how I noticed, but also a friend told me he had the same issue... so pls help with that
Quote the name ?
%USERNAME% - is an variable
"%USERNAME%" might do ...i've not tried ..
if not - try to quote the whole parameter
"%USERNAME%:F"
Code:
@echo off
if %PROCESSOR_ARCHITECTURE% == AMD64 (
regsvr32 -u %windir%\system32\gameux.dll
regsvr32 -u %windir%\SysWOW64\gameux.dll
TAKEOWN /F %windir%\system32\gameux.dll
TAKEOWN /F %windir%\SysWOW64\gameux.dll
ICACLS %windir%\system32\gameux.dll /grant "%USERNAME%":F
ICACLS %windir%\SysWOW64\gameux.dll /grant "%USERNAME%":F
ren %windir%\system32\gameux.dll "__DISABLED__gameux.dll__"
ren %windir%\SysWOW64\gameux.dll "__DISABLED__gameux.dll__"
) else (
regsvr32 -u %windir%\system32\gameux.dll
ICACLS %windir%\system32\gameux.dll /grant "%USERNAME%":F
ren %windir%\system32\gameux.dll "__DISABLED__gameux.dll__"
)
pause
Same goes to the first parameter - dll location
if windows is not located in:
C:\Windows\
but in
C:\Shitty Windows 10\
then the location also need to be quoted:
ICACLS "%windir%\system32\gameux.dll" /grant "%USERNAME%":F
Code:
@echo off
if %PROCESSOR_ARCHITECTURE% == AMD64 (
regsvr32 -u "%windir%\system32\gameux.dll"
regsvr32 -u "%windir%\SysWOW64\gameux.dll"
TAKEOWN /F "%windir%\system32\gameux.dll"
TAKEOWN /F "%windir%\SysWOW64\gameux.dll"
ICACLS "%windir%\system32\gameux.dll" /grant "%USERNAME%":F
ICACLS "%windir%\SysWOW64\gameux.dll" /grant "%USERNAME%":F
ren "%windir%\system32\gameux.dll" "__DISABLED__gameux.dll__"
ren "%windir%\SysWOW64\gameux.dll" "__DISABLED__gameux.dll__"
) else (
regsvr32 -u "%windir%\system32\gameux.dll"
ICACLS "%windir%\system32\gameux.dll" /grant "%USERNAME%":F
ren "%windir%\system32\gameux.dll" "__DISABLED__gameux.dll__"
)
pause
Tested and works :
Mine win didn't have on in syswow64...(i guess i've already moved it