Regedit change path windows update bat file - regedit

So i'm preparing some desktop for the clients of my job, and i need to turn off the update windows 10 so i need to change the path of it and i need to creat a bat file to change it the path is:
->\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wuauserv
I tried this but wont work -> REG ADD \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wuauserv /v ImagePath /d %systemroot%\system32\svchost.exeXX -k netsvcs /t REG_EXPAND_SZ /f
I'm totally new at this so i would appreciate your help.

Related

Application URI Scheme opening file in program

I'm trying to get a video to play in VLC via URI
My HTML:
Click Me
My Registry:
REG ADD "HKEY_CURRENT_USER\SOFTWARE\Classes\vlc-proto" /ve /d "URL:VLC Protocol" /f
REG ADD "HKEY_CURRENT_USER\SOFTWARE\Classes\vlc-proto" /v "URL Protocol" /t REG_SZ /d ""
REG ADD "HKEY_CURRENT_USER\SOFTWARE\Classes\vlc-proto\DefaultIcon" /ve /d "%output%,1" /f
REG ADD "HKEY_CURRENT_USER\SOFTWARE\Classes\vlc-proto\Shell\open\command" /ve /d "\"%output%\" \"%%1\"" /f
It works until the point of VLC trying to open the file I specified above...
EDIT:
If I remove the first 2 forward slashes in the href link, something interesting happens, for some reason the dir of chrome joins the url and the "vlc-proto" is gone, so maybe there is something similar to the "//" that could also hide the "vlc-proto" and thus finally make it work.

Batch File to start chrome:chrome and update

I am trying to write a batch file to force Google Chrome to Update. If I use the following it is close however the batch file below takes out the : and shows a This Site Can't Be Reached notification:
#echo on
start chrome.exe \chrome://chrome
pause
If I had a batch file to open chrome:chrome in a startup page that would be helpful as well.
You could use the profile manager and create a user/profile with chrome://chrome as the start page. Or manually/per batch create a copy of the preferences file in "%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default" and switch between two versions of the file.
The following batch will just create a backup with datetime appended to the name to start with.
#Echo off
:: GetISODT
for /f "tokens=1-3 delims=.+-" %%A in (
'wmic os get LocalDateTime^|findstr ^^[0-9]'
) do Set _DT=%%A
Pushd "%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default"
copy Preferences Preferences_%_DT%
start chrome

Error: Command failed: C:\Windows\system32\cmd.exe /s /c “rm ./mean/package.json”

How to fix this error. When i use command “yo meanjs”, but not show as in video. It’s:
undefined
You’re using the official MEAN.JS generator.
What mean,js version would you like to generate? i choose 0.4.0
In which filder would you like the project to be generated? mean
Cloning the MEAN repo…
Then it appear error:
Command failed: C:\Windows\system32\cmd.exe /s /c “rm ./mean/package.json”
‘rm’ is not recognized as an internal and external command, operable program or batch file.
you should install git on windown 7 and select folder you want . click -> right mouse -> Git Bash
After type command : "yo meanjs" and everything will good
The tpt2213's answer works, but it can't select menu items of "yo meanjs" with arrow keys.
You need to have cmd.exe with PATH setting, which includes the git command and Unix commands like the rm.
If you install git on window 7 in the folder, "C:\Program Files\Git", set PATH before you run "yo meanjs".
set PATH=C:\Program Files\Git\usr\bin;C:\Program Files\Git\bin;%PATH%
yo meanjs

Windows Batch Script for 2 Cases

I use the following .bat script
set varSearch="C:\Users\User1\Desktop\Test-folder\*.crypt8"
for /f %%i in ('dir %varSearch% /B ') do set varSearch= %%i
WhatsAppViewer.exe -decrypt8 %myName% key exp.db
sqlite3.exe exp.db<command.txt
cd C:\xampp\mysql\bin
mysql -u admin -p1234 < query.txt
The basic function is to find a file thats ending with .crypt8, decrypt it, save as csv and import to mysql. Its working correctly
But i need some extra features
Case1
The folder contains more than 1 file, and every file has to be processed, but only once
Case 2
Everyday at least one file gets added. It would be superb if the .bat could be scheduled as a task, and run every night and just process the new added files.
Does anybody has a solution for this?
Case 2
The forfiles command processes groups of files based on date. This does files made today only.
forfiles /d 0 /m *.crypt8 /c "cmd /c echo #fname in #path"
Case 1
Your code has errors, it may work but not under all conditions.
The easist way is to put the sequence of commands in a batchfile for a file (%1) which is passed on command line, and use forfiles to call it.

Windows: How to open a .exe in a shell window that won't close?

I've had this problem for ages, and it's SO ANNOYING.
Suppose I want to run mysqldump.exe... here's my process: Start->run, type "cmd" ... dir into directory after directory until I finally get to c:/program files/mysql/bin/then I can FINALLY call "mysqldump.exe"
I don't mind using Windows Explorer to get to c:/program files/mysql/bin, but then I can't freaking open up any of the .exe files in a shell, and I can't open up shell with the directory being that one.
How can I do this?
This is what I do for those type of commands:
Drag a copy of the "Command Prompt" shortcut onto your desktop.
Open the properties of the shortcut.
Change the Target: field to: %SystemRoot%\system32\cmd.exe /k mysqldump.exe
Change the Start in: field to: c:/program files/mysql/bin/
Hit Ok, then rename the short cut from "Command Prompt" to "Mysqldump".
Then just double click the icon whenever you need that command. The "/k" option for cmd.exe leaves the window open.
Microsoft released a powertoy for Windows XP called Open Command Prompt Here. If you're using Vista, all you need to do is hold shift and right-click.
here's my process: Start->run, type
"cmd" ... dir into directory after
directory until I finally get to
c:/program files/mysql/bin/ then I can
FINALLY call "mysqldump.exe"
Why not just the following?
c:
cd "c:/program files/mysql/bin"
mysqldump.exe
Better yet, put this in a batch file and execute it.
You can also create a shortcut for cmd.exe and set the "Start in" directory to "c:/program files/mysql/bin".
You can download an add-in so that you can right click on the folder and open a command prompt. Saves a lot of time and you say you dont mind navigating to the location.
http://download.microsoft.com/download/whistler/Install/2/WXP/EN-US/CmdHerePowertoySetup.exe
A nice little trick is that the icon in the adress bar of explorer could be dragged to a command line window and it insert the full path at your current cursor position.
It doesn't work in vista but if you SHIFT-RightClick on a folder you have an "Open Command Windows Here" option that appears.
Under xp you could have it by saving this as a .reg and executing it :
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\cmd]
#="Open Command Prompt Here"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\cmd\command]
#="cmd.exe /k pushd %L"
Just use the explorer to navigate to the bin or any directory. then enter cmd at the address bar und hit return. the command line with start at this location.
You can do it with python:
If you don't have activepython already, download from ActiveState's Website. Next, run PythonWin and create a new script. Write the following:
from subprocess import *
Call("c://program files//mysql//bin//mysqldump.exe")
Save the script somewhere. When you want to run it, just doubleclick. There are easier ways if you like writing batch files, but Python is more succinct than even windows for this case.
Just put c:/program files/mysql/bin/ into your path...
Then you can run mysqldump.exe directly without even opening a cmd prompt by typing it into " Start > Run "
I was using the MS PowerToy for a while but moved on to the open source Open Command Prompt Shell Extension because of the key feature:
(copied verbatim from the website)
The ability to open a command prompt in the directory that you are currently in by right-clicking on any empty screen space in the directory. This eliminates the need to navigate up a level in order to open a command prompt in the current directory.
Having to actually click on a folder to open the command prompt using the MS tool was a annoyance for me... especially since I always need to run command line tools on my current directory at the time.