对不起我的英语不好!我是葡萄牙语!
我想知道是否可以使用批处理制作带有“Google Chrome”的“Gif Viewer”。我想做的是“谷歌浏览器”通过“简单点击”打开gif,因为我在图形设计课程,在我们学校,电脑有管理员权限,所以我们不能更改 gifs 默认设置,由“谷歌浏览器”打开。我们想通过“Chrome”打开 gif,因为它是快速的动画 gif 显示器,并且可以预览我们在 html 中做的网站。另一个原因是因为我喜欢了解有关批处理的更多信息...
我的问题是:如何创建一个“文件搜索器”来查找 GIF1、2 或 3,并使用 google chrome 打开它(我需要这样做以避免更改 gif 和“google chrome”的目录,无论何时我更改文件夹,或将程序复制给我的同学)...
这是我的完整批次(有点动态):
ECHO OFF
CLS
TITLE ***Gif Viewer\**Hubert Kenobi**/GoogleChromePortable***
:S
color 12
color 0B
color 12
color 23
color 45
color 62
color 89
color 91
color 37
color 12
color 43
color 51
color 15
color 42
color 2
color 3
color 0A
:MENU
ECHO .
ECHO \
ECHO HK
ECHO .......................................................
ECHO ... ...
ECHO .. ..
ECHO . *--Gifs Viewer \By Hubert Kenobi/ Google Chrome--* . ===
ECHO .. ..
ECHO ... ......
ECHO ....................................................... ...
ECHO .. Y or y - Confirm .. ..
ECHO . N or n - Reject/Next . . === ===
ECHO .. E or e - Exit .. ..
ECHO ....................................................... ...
ECHO ... ......
ECHO .. To open a gif, put the gif in the folder where is the ..
ECHO . "Gif Viewer" with the name of Gif1, or Gif2 Gif3... . ===
ECHO .. PRESS "Y" or "N" to select your task or "E" to EXIT ..
ECHO ... ...
ECHO .......................................................
ECHO HK Hubert Kenobi
ECHO / My spaceship!!!
ECHO .
ECHO Do you want to see/watch gif1 ?
ECHO.
SET /P M=Type Y, N, or E, then press ENTER:
IF %M%==Y GOTO Y
IF %M%==N GOTO N
IF %M%==E GOTO EOF
IF %M%==y GOTO Y
IF %M%==n GOTO N
IF %M%==e GOTO EOF
:Y
## I want to make a searcher that run the gif and open it with chrome!! HELP ME!!! ##
ECHO This will take few seconds...
start GoogleChromePortable.exe "L:\Informatic\GoogleChromePortable-GifViewer\Gif1.gif"
GOTO S
:N
ECHO Do you want to see/watch gif2 ?
ECHO.
SET /P M=Type Y, N, or E, then press ENTER:
IF %M%==Y GOTO Y2
IF %M%==N GOTO N2
IF %M%==E GOTO EOF
IF %M%==y GOTO Y2
IF %M%==n GOTO N2
IF %M%==e GOTO EOF
:Y2
## I tried this way, but it didn't work and exit automatically! ##
pushd L:\Site HTML onlive-ac
FOR /F "delims=" %F IN ('dir /S /b Gif1.gif) DO SET ExePath="%F"
%ExePath%
Goto S
:N2
ECHO Do you want to see/watch gif3 ?
ECHO.
SET /P M=Type Y, N, or E, then press ENTER:
IF %M%==Y GOTO Y3
IF %M%==N GOTO N3
IF %M%==E GOTO EOF
IF %M%==y GOTO Y3
IF %M%==n GOTO N3
IF %M%==e GOTO EOF
:Y3
## I tried this way, but it didn't work! This opens the Gifs independently ##
## with the default program (Quick Time Player "slow program") and then ##
## opens the Chrome in the Home page. ##
SETLOCAL
FOR /L %%a IN (2,1,3) DO (
FOR /F "tokens=2 delims==" %%b IN ('WMIC LogicalDisk Where "DriveType=%%a" Get DeviceID /Format:List') DO (
FOR /F "tokens=*" %%c IN ('DIR %%b\GoogleChromePortable.exe "Gif3.gif" /b /s') DO (
CALL "%%c"
)
)
)
EXIT /B
N3:
GOTO MENU
这是我的摘要批次:
1.我想做一个运行gif的搜索器,用chrome打开!!!!!!这有效,但不是我想要它做的功能!帮助我!
:Y
ECHO This will take few seconds...
start GoogleChromePortable.exe "L:\Informatic\GoogleChromePortable-GifViewer\Gif1.gif"
GOTO S
2.这个方法我试过了,不行,自动退出!
:Y2
pushd L:\Site HTML onlive-ac
FOR /F "delims=" %F IN ('dir /S /b Gif1.gif) DO SET ExePath="%F"
%ExePath%
Goto S
3.这个方法我试过了,不行!这将使用默认程序(Quick Time Player“慢程序”)独立打开 Gif,然后在主页中打开 Chrome。
SETLOCAL
:Y3
FOR /L %%a IN (2,1,3) DO (
FOR /F "tokens=2 delims==" %%b IN ('WMIC LogicalDisk Where "DriveType=%%a" Get DeviceID /Format:List') DO (
FOR /F "tokens=*" %%c IN ('DIR %%b\GoogleChromePortable.exe "Gif3.gif" /b /s') DO (
CALL "%%c"
)
)
)
EXIT /B
请帮我!!! 我做了一个 PrintScreen 来查看目录: http ://s5.postimage.org/h2emaxvfb/Background_Directoryies.png
一种可能的解决方案是创建第二个批处理程序来更改目录(复制或移动),从而修改第一个批处理。是否可以?修改其他批次的批次?感谢帮助!