.bat to stop windows Update - batch-file

I have gotten tired of searching how to stop Windows Updates from running permanently in Windows 10 since every after a restart it runs again. It came to my mind that maybe I could make a .bat file that could stop the windows update in the services so that I could just click it every time I turn on my laptop.
I have known of the sc start/stop serviceName. My question is, what is the name of the Windows Update service? Because when I type in windows update in in the serviceName, it would show that the service is not installed.

simple batch which you can even put into your Run at start up. This one works on Windows 8 and older should perhaps work on Windows 10 as well.
#echo off
net stop "Windows Update"
You can also stop it together with the background downloading processes.
This one works on windows 10
#echo off
net stop wuauserv
net stop bits
net stop dosvc

The name of your service is wuauserv.
If you want to get a list of display names with their associated service names you can do so relatively quickly by utilising WMIC at your Command prompt.
WMIC /Output:Services.txt Service Get DisplayName,Name&&Services.txt
The Services.txt file will be located in the Command prompt's current directory.

The powershell commands to :-
Stop Windows update is:
Stop-Service wuauserv (Run as admin)
Start Windows update is:
Start-Service wuauserv

Unplug the LAN wire or disconnect your system from the internet as soon as possible. Write "Services.msc" in a run (Windows key + R), then scroll down and search Windows update option there. Double click on that, select the startup type "disabled" then click ok, it will stop the windows update and also fix blue screen problems during upgrade on Windows 10.

Related

Wpf application doesn't start at startup

I have developed a wpf app and want it to run whenever the computer starts up.However I have been unable to do so......I have tried editing registry like this answer...
Launch Window on Windows startup
Interesting thing is the app does autostart when there is internet connection.It doesn't when there is no internet. I do need internet connection at some point of time to sync the data to internet application. However this should not have affected the startup of the application.
Any ideas???
I guess you can set up a timer, and after several minutes, check out your internet, if the internet is ok, then run your application continuely. If not, reset the timer, and check again.
Go to the run line (Windows + R). Type "shell:common startup" press "enter". Place a shortcut in that folder and restart your machine (depending on what the *.exe is doing you may need to set its properties to run as administrator).

Batch Scripting .. what means: <name>.exe //IS//%SERVICE_NAME

So i have a Batch Script which i got trough a task at work, there is an error inside the script which i lokated at the following position of the code
REM Install service
echo register Service...
%INSTALL_PATH%<name_of_exe>.exe //IS//%SERVICE_NAME% #error here
echo successfully installed %SERVICE_NAME%.
So as squashman told after starting of an .exe there follow parameters. So to this point it is clear,
//IS//%SERVICE_NAME% #is parameter
So i want to know if //IS// is some kind of "batch-magic". So it is not some kind of crazy Windows Path since there are "/" not "\". So my it is some kind of character-escaping?
So i found it out.
There is a Programm called Procrun from ApacheCommons with the following description
Procrun is a set of applications that allow Windows users to wrap (mostly) Java applications (e.g. Tomcat) as a Windows service.
The service can be set to automatically start when the machine boots and will continue to run with no user logged onto the machine.
So now the Problem line was easy to understand since the .exe belongs to procrun.
<name>.exe //IS//%SERVICE_NAME% # //IS - install service
# //%SERVICE_NAME% - the name

PSEXEC Crashing PC

I have been using psexec successfully for a couple of years now. Recently, I have had some major issues when running on several remote machines. Calling psexec from a simple batch file seems to completely crash (restart) the computer, leaving the bewildered pc locked on the DELL startup screen (same issue on 3 separate computers).
Anyone having a similar issue? This seems to occur when using the old and new version of psexec (May 2014 release v2.11). Could this be a windows update issue (Windows 7 64bit)?
FYI, here's the process I call from a .bat file (run_model.cmd contains local exe).. note: This opens up in a loop, so that I get a new window for each model run.
start cmd.exe /c psexec -i -s \\VOSTRO460-4 \\VOSTRO460-4\model\run_model.cmd
If not, can anyone suggest an alternative to psexec which works as simply as this?
Cheers
Neil

Autostart process on boot

I'm making a Cloud Drive program for my university (like dropbox for example, but much simpler), which let users automatically upload files on a server and share them with other users
I wanted to make an option, so that if someone boots the machine, the process will start automatically
What I think I have to do is to add an entry in the register at the key: HKEY_LOCAL_MACHINE/sofware/Windows/CurrentVersion/Run and I wrote these lines of code:
system("REG ADD HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Run /v uCloud.exe /t REG_SZ /d \"C:\\Desktop\\uCloud\\uCloud.exe\" /f");
I also tried with the functions: RegOpenKeyEx and RegSetValueEx
the problem is that in both the cases I need administrator rights
If I edit the HKEY_CURRENT_USER the program automatically starts on boot, but it doesn't work at all (I mean I see the process, but it does nothing. I have to close the process and open it again manually and then it starts to download and update the stuffs)
Thanks a lot
When you use the task scheduler, you can use admin rights; see here: http://www.techrepublic.com/blog/window-on-windows/make-vista-launch-uac-restricted-programs-at-startup-with-task-scheduler/616

Start Play Application and Close Window

I have a play application on a Windows 7 machine which I want to start via double click on a batch file.
This batch file starts a service. Calls the play application to run in production mode, waits for 5 seconds and open a browser with a specified url.
Therefore I used the following script:
call net start service1
CALL "D:\play-1.2.5\play.bat" start --%%%%prod -Dprecompiled=true
TIMEOUT /T 4
call "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" localhost:9000
exit
Now when I start the batch file the window opens and all commands are executed. Sadly Play is still writing his output to cmd and the window is not disappearing. If I close the window manually play is stop executing.
If I run play with "play start" from cmd, play is starting in the background and everything is fine. Play still runs even if I close the window.
I want to have exactly this behaviour when I start the application with my batch file.
Thanks
If you were using a linux-like environment, I' d recommend you to use 'nohup' command and a '&' sign in the end. However, as far as I know there is no direct equivalent of beautiful 'nohup' command on Windows, unfortunately. So, what I can think of is, you can create a tiny win api application that utilizes CreateProcess command and give it the required parameter to hide command line window as soon as the process is created. There are also other process creation functions such as WinExec that you can use to hide command line.
I don't know what Play is so I can only take a guess :) but try using the batch without the call's as I don't think they are necessary, and you never know, might fix the issue.
1) You see Play's output because ot redirect only system.out but write system.err to the same console.
2) I also have this problem and looking for a solution. As a workaround you could try to use some Java Wrapper and install your Play! application as a Windows Service.
3) Play! app could be started via Ant task. I haven't tried this yet.

Resources