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.
Related
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.
I need to check for the chrome browser in any Windows system by running a .bat file. The batch file should be able to check if Chrome browser is installed in the system. if its installed want to store the path in a variable and use that.I am creating chrome kiosk app..so need to find the chrome path dynamically.Please help me
start "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --kiosk --fullscreen --incognito "website url"
After our discussion in chat, we found that if chrome is not installed, it will not launch. therefore simply use:
start "" "chrome" --kiosk --fullscreen --incognito "https://www.netflix.com/"
We need to ensure that all other chrome windows are closed as it will not open kiosk mode if chrome is already open.
That means if chrome is not found by default using start it is not installed.
Older tries:
This batch file is assuming chrome is installed correctly:
for /F "delims=" %%a in ('where chrome') do (
start "" "%%a" --kiosk --fullscreen --incognito "website url"
)
pause
Once you confirmed that it is working, simply remove echo from the last line to actually perform the start.
The next option, seeing as where might not work is too search for the file.
pushd C:
cd\
for /F "delims=" %%a IN ('dir /b /a-d /s chrome.exe') do (
start "" "%%a" --kiosk --fullscreen --incognito "https://www.netflix.com/in/"
)
pause
The simple solution is:
start "" chrome.exe --kiosk --fullscreen --incognito "website url"
It is necessary to specify an empty title with "" or command START interprets the first double quoted string as optional title string. Run in a command prompt window start /? for help on this command and its options.
The reason for starting successfully Chrome without full path and without its folder path being included in environment variable PATH is explained in answer on Where is START searching for executables?
chrome.exe is (usually) registered correct according to guidelines of Microsoft for Application Registration. So START is capable finding the path of Chrome application itself.
Solution with first checking if Chrome is installed and registered at all:
#echo off
%SystemRoot%\System32\reg.exe query "HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe" >nul 2>&1
if not errorlevel 1 start "" chrome.exe --kiosk --fullscreen --incognito "website url"
I have mapped F6 and F7 in vimrc file.
:nnoremap <F6>:w<cr> :!start cmd C:\Program Files (x86)\Google\Chrome\Application\chrome.exe %<CR>
:nnoremap <F7>:w<cr> :exe '!"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" %'<CR>
In CMD ,it works fine for me.
C:\Users\pengsir>"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" g:\\my.html
When i open g:\my.html in gvim and enter into normal status ,press F6 or F7,why my chrome can not open the my.html?
<!DOCTYPE html>
<html>
<HEAD>
<META CHARSET="UTF-8" />
<TITLE> FIRST WEB</TITLE>
<body>
it is my first web
</body>
</html>
When i press F6 IN GVIM ,
Okay, let's solve this step by step:
:nnoremap <F6>:w<cr> :!start cmd C:\Program Files (x86)\Google\Chrome\Application\chrome.exe %<CR>
First, there's whitespace missing between the lhs (<F6>) and the :w... rhs; you're currently mapping the key combo <F6>:w<cr>.
:nnoremap <F6> :w<cr> :!start cmd C:\Program Files (x86)\Google\Chrome\Application\chrome.exe %<CR>
That gives me an open command prompt, but no Chrome. You need to pass either /C or /K so that the remainder is executed as a command; cmd.exe /? tells you this. Let's first use /K to be able to read any errors.
:nnoremap <F6> :w<cr> :!start cmd /K C:\Program Files (x86)\Google\Chrome\Application\chrome.exe %<CR>
I now get 'C:\Program' is not recognized as an internal or external command, operable program or batch file.; we need quoting. We could manually enclose the path in double quotes, but as you probably want to handle any file names passed via %, it's better to let Vim do the quoting. For that, we need :execute (to insert the expressions) and shellescape().
Another hairy quirk of cmd.exe is that once you use quoting, you need to quote the entire command-line again, too. (Don't feel stupid if this is over your head; Microsoft and compatibility down to MS-DOS is to blame for this mess. Vim underwent improvements in that area, too; be sure to use at least a version 7.3.800, or 7.4.)
:nnoremap <F6> :w<cr> :execute '!start cmd /K "' shellescape('C:\Program Files (x86)\Google\Chrome\Application\chrome.exe', 1) shellescape(expand('%'), 1) . '"'<CR>
That one opens the current HTML file in Chrome for me. For finishing touches, just get rid of the left-behind command prompt (/C), and join the two Ex commands, replacing :w with the on-demand :update:
:nnoremap <F6> :update<Bar>execute '!start cmd /C "' shellescape('C:\Program Files (x86)\Google\Chrome\Application\chrome.exe', 1) shellescape(expand('%'), 1) . '"'<CR>
You can make that a bit more resilient by always passing the full absolute path:
:nnoremap <F6> :update<Bar>execute '!start cmd /C "' shellescape('C:\Program Files (x86)\Google\Chrome\Application\chrome.exe', 1) shellescape(expand('%:p'), 1) . '"'<CR>
I am trying to create an extension where each window of chrome has its own session. We used incognito earlier, but the problem is that while the main window and the incognito window have separate sessions, the session is shared between the various incognito windows.
Is there any way of configuring chrome to use a separate session every time an incognito window is opened?
Your goal will be start a Chrome instance with a new user data directory. The cookies will be isolated in each instance.
In the extension to implement a way to reach the same goal as this command on cmd:
chrome.exe --user-data-dir="C:\temp\user1"
I had a similar problem where i want to use google chrome for browsing and debugging for work and chrome is pretty original when it comes to sessions. I wrote this small batch script to duplicate the default profile, clear session information and then use the new profile. Old duplicate profiles are also cleared before the new ones are created. The result is a new session with all the old profile stuff.
#echo off
rem folder prefix for the new profile folder
set folderNameStart=profile_
rem generate and format the date creating the new folder name
For /f "tokens=1-6 delims=/ " %%a in ('date /t') do (set mydate=%%c%%b%%a)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a%%b)
set folderName=%folderNameStart%%mydate%%mytime%%random%
rem set the profile path and the folder destination as well as the directory to
delete
set profilePath="C:\Documents and
Settings\%USERNAME%\AppData\Local\Google\Chrome\User Data\Default"
set profileDestination="C:\Documents and
Settings\%USERNAME%\AppData\Local\Google\Chrome\User Data\"%folderName%
set profileLocation="C:\Documents and
Settings\%USERNAME%\AppData\Local\Google\Chrome\User Data\"
rem iterate through directory and delete all the existing profile folders
CD %profileLocation%
echo %profileLocation%
for /D /r %%G in ("%folderNameStart%*") do rmdir /q /s "%%G"
rem this will copy the old profile directory
echo D | xcopy %profilePath% %profileDestination%
rem delete the session storage and its contents if its exist
rmdir /q /s "C:\Documents and Settings\%USERNAME%\AppData\Local\Google\Chrome\User
Data\%folderName%\Session Storage"
rem start google chrome with the new profile folder
start "Chrome" "C:\Program Files\Google\Chrome\Application\chrome.exe" --profile-directory="%folderName%"
To make it work need to know difference between open "new window" in chrome, if there no difference then no way to do it in that case. Another way if know what difference when use incognito mode and use it to add in chrome "Open tab in new window pofile 1".
I'm using the following code to delete all instances of Acad.lsp found on my C:\ drive but I want to make one exception, which is C:\Autocad 2010\Support.
How can I achieve this?
del "C:\ICT\acad.lsp" /q /a /s
From a command line you could use the batch file for command (I'm assuming that you're using a Windows command prompt or similar here). This is a powerful command that will let you loop through a set of "things" - with the right options, these "things" may be files.
The following command, when run in the C:\ICT directory, should do what you want:
for /F "usebackq" %a in (`dir /s /b acad.lsp ^| find /v "C:\Autocad 2010\Support"`) do #echo %a
Note that I'm using #echo here so that you can test that the results are as you expect before you change the #echo to del.
If you wanted to put this into a batch file, you should change %a to %%a.
A little explanation on what's happening:
for /F "usebackq" %a in (...) runs the command that is between the back-quotes, and runs the command following the do on each item that results. The command in my example above does a recursive dir for the file acad.lsp, and puts that through the find command to remove the one you want to keep. The remaining files are the ones that you will want to delete.