用一个批处理文件更改墙纸,在程序关闭。可能? [英] Changing Wallpaper with a batch file, on program close. Possible?

查看:160
本文介绍了用一个批处理文件更改墙纸,在程序关闭。可能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建一个批处理文件,当程序在Windows 7关闭我已经使用这个尝试,这将改变我的背景,但它不能正常工作,甚至当我注销并重新登录:

 关闭@echo
注册/添加HKCU \\控制面板\\桌面\\墙纸/ V墙纸/吨REG_SZ / D C:\\影像\\ wallpaper.bmp


解决方案

有你的命令的一些错误:


  1. 您已经unnecessarry / 添加到添加命令。

  2. 您不要在引号(空间逃生)括起来注册表键的名称。

  3. 您已经指定路径错误(额外壁纸结尾)。

这应该做的伎俩:

  REG ADDHKCU \\控制面板\\桌面/ V墙纸/ F / T REG_SZ / D C:\\影像\\ wallpaper.bmp

当然,如果壁纸路径包含空格,您必须将其括在引号了。

我还添加键 /˚F给力壁纸是否已设置覆盖。

I'm trying to create a batch file that will change my background when a program closes on Windows 7. I've tried using this, but it doesn't work, even when I log off and log back in:

@echo off
reg /add HKCU\Control Panel\Desktop\WallPaper /v wallpaper /t REG_SZ /d c:\images\wallpaper.bmp

解决方案

There are some errors in your command:

  1. You have added unnecessarry / to add command.
  2. You don't enclose registry key name in quotes (for space escape).
  3. You have specified wrong path (extra WallPaper at the end).

This should do the trick:

reg add "HKCU\Control Panel\Desktop" /v Wallpaper /f /t REG_SZ /d c:\images\wallpaper.bmp

Of course, if the wallpaper path contains spaces you must enclose it in quotes too.

I also added key /f to force overwriting if wallpaper is already set.

这篇关于用一个批处理文件更改墙纸,在程序关闭。可能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆