Batch file Proxy Setting Disable not working Win 10 - batch-file

The following line of script from a Batch file works fine in Win 7 and successfully disables the proxy setting in IE, but when i have tried it on Win 10 it dosnt work the proxy setting in unaffected, any ideas why?
UAC is auto elevated as per UAC so admin privileges is not an issue.
i have checked with regedit and the HKCU directory seems to be the same path on both.
echo LAN Settings - Proxy Setting *Disable*
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" ^ /v ProxyEnable /t REG_DWORD /d 0 /f
IE > Internet Options > Connections > LAN Settings

Related

Batch script not working after deploy with SCCM

I have created a script to manage manually the windows update clean up. When i try to run as admin the below script, it works fine. i am trying to deploy it through SCCM. The script is copied in the ccmcache folder but it's not running. Any help please ?
#echo off
echo Config cleanmgr flag 5100.
call reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Update Cleanup" /v StateFlags0011 /t REG_DWORD /d 0x2 /f
%systemroot%\System32\cleanmgr.exe /sagerun:11

.bat file works on two domain systems but not other systems

The .bat file is located in C:\Temp in a domain network. It will be ran via shortcut on user desktop. Using this setup, on my system and on one other system (laptop Win 7 Pro and Desktop Win 7 Pro), it works. Different users. I have admin account, and test profile call joe user (juser) no admin rights. Does what it is intended to do. Tried on additional users desktops under their profile and it fails. Does not find the files. I added pauses after each command to decipher and found the errors. Verified files are indeed there. Able to browse to location and actually see the files.
Can someone help point out what I am not seeing?
Again it works on my system, a default user with no admin rights systems for testing purposes, but fails on others.
#echo off
title This will delete you cookies!
echo This will program will close all Chrome Windows and clear cookies. Make sure all data is saved before pressing any key.
pause
echo Are you sure you are ready?
pause
echo Absolutely sure?
pause
taskkill /IM Chrome.exe /F
cd %USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\
del Cookies
del Cookies-journal
del Current Session
…perhaps:
TaskKill /F /IM Chrome.exe /T 2>Nul
CD/D "%LOCALAPPDATA%\Google\Chrome\User Data\Default"
Del/A/F Cookies Cookies-journal "Current Session"
Assuming cookies, cookies-journal etc. are directories, you need rd /s /q "cookies" etc.
rd removes a directory, /s means "and subdirectories" /q "quietly" and the quotes need to surround the target directory-name where the directory-name "contains spaces" (and are harmless otherwise)

winrs reg query works but reg query hostname does not

I am trying to verify that the usbstor driver is set to disabled on a remote machine in my domain in a vbscript but I'm having issues. I've turned to troubleshooting from the command line.
Using plain old reg query fails.
reg query \\hostname\hklm\system\currentcontrolset\services\usbstor /v start
ERROR: The network path was not found.
But if I run essentially the same command with winrs, it works fine.
winrs -r:hostname reg query hklm\system\currentcontrolset\services\usbstor /v start
HKEY_LOCAL_MACHINE\system\currentcontrolset\services\usbstor
start REG_DWORD 0x4
Both commands work fine on other computers. What gives with this one?
Regardless of the computer I'm running the commands against, I open the firewall with this command:
winrs -r:hostname netsh advfirewall firewall set rule
group="Windows Management Instrumentation (WMI)" new enable=yes
The service RemoteRegistry is not running (or not accessible) on the remote host. You should be able to start it like this:
sc \\hostname config RemoteRegistry start= auto
sc \\hostname start RemoteRegistry
If the service is running but still not accessible, check that the Windows Firewall allows RPC.

Batch script does not execute properly when launched automatically

I've an issue that seems a privilege issue but i really do not understand what is happening.
This is my installation script :
...some command...
C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil C:\Programmi\ProgDir\ProgService.exe >> log.txt
ping 127.0.0.1 -n 5 > null
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /f
ping 127.0.0.1 -n 2 > null
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d C:\Programmi\ProgDir\ProgName.exe /f
I try this script using installation wizard (created by winrar) and manually , in both cases i give to the script admin privilege; to prove this the service is installed successfully (it require administration privilege, so the script has these privileges as expected) but the registry is not affected if the script is launched by the wizard.
Can anybody explain to me what is happening ?
Thanks in advance (and sorry for my poor english)

sql server installation errors regarding WMI service

I am trying to install SQL Server 2008 and during the pre requisite check its always fails on
WMI service "Failed".
I went to the event viewer and found this error in there.
"Failed to Initialize WMI Core or Provider SubSystem or Event SubSystem with error number 0x80040154. This could be due to a badly installed version of WMI, WMI repository upgrade failure, insufficient disk space or insufficient memory."
I know there is a lot of space available in my hard drive. Also i tried a few things after googling like WMIFIX.bat file. The file ran fine but did not fix the problem.
Has anyone had this problem? If so do you have a solution?
if you have a domain so Run this Command with administrator Privilege
you can copy this Command and Past in Notbat with .bat extention. and run them.
Rundll32 setupapi,InstallHinfSection Ndi-Steelhead 132 %windir%\inf\netrass.inf
Netsh firewall reset
sc config SharedAccess obj= LocalSystem password= "" type= interact type= own
sc config RpcSs obj= LocalSystem password= "" type= interact type= own
sc config RpcLocator obj= LocalSystem password= "" type= interact type= own
sc config winmgmt obj= LocalSystem password= "" type= interact type= own
sc config Wmi obj= LocalSystem password= "" type= interact type= own
net start winmgmt
net start Wmi
net start RpcSs
net start RpcLocator
net start WmiApSrv
netsh firewall add portopening TCP 135 "Open Port 135"
netsh firewall add portopening TCP 445 "Open Port 445"
netsh firewall add portopening TCP 139 "Open Port 139"
netsh firewall set opmode mode=DISABLE
shutdown /r
if your problem did not solve you Can execute this Command in Command Prompt with admin privilege.. you can just copy and paste them in notepad and rename it with .bat extention an run the file..
net stop winmgmt
C:
cd %systemroot%\system32\wbem
rd /S /Q repository
regsvr32 /s %systemroot%\system32\scecli.dll
regsvr32 /s %systemroot%\system32\userenv.dll
mofcomp cimwin32.mof
mofcomp cimwin32.mfl
mofcomp rsop.mof
mofcomp rsop.mfl
for /f %%s in ('dir /b /s *.dll') do regsvr32 /s %%s
for /f %%s in ('dir /b *.mof') do mofcomp %%s
for /f %%s in ('dir /b *.mfl') do mofcomp %%s
echo DONE reboot
pause
just it and have a good day !!!!!
Run the WMI Diag Utility. Here are the instructions how to do this:
Download WMIDiag.
To run the WMIDiag tool:
1. Open a command prompt window.
(Use "Run As Administrator", if applies to your Operating System version)
2. Navigate to the wmidiag folder that was created when you ran Wmidiag.exe.
3. Type cscript wmidiag.vbs.
View what the output of that is and post what it says. That'll give you a better indication of what's happening.
Here is a reference for the above instructions.
I faced this issue when I tried to install SQL Express
For me, following steps worked out which I referred from http://mikeymurph.me/fix-wmi-service-error/
Run the following in Powershell in Administrator mode
PS C:\Windows\system32> winmgmt /verifyrepository
WMI repository verification failed
Error code: 0x80041002
Facility: WMI
Description: Not found
PS C:\Windows\system32> Winmgmt /resetrepository
WMI repository has been reset
Now try to install SQL Server again.

Resources