|
使用bat调用powershell,就是速度比较慢。
- set img=C:\Users\Administrator\Desktop\重装\壁纸.jpg
- reg add "HKCU\Control Panel\Desktop" /v "Wallpaper" /d "%img%" /f
- powershell "Add-Type -TypeDefinition 'using System;using System.Runtime.InteropServices;public class a{[DllImport("""user32.dll""")]public static extern int SystemParametersInfo(int a,int b,string c,int d);public static void e(string f){SystemParametersInfo(20,1,f,2);}}';[a]::e("""%img%""")"
复制代码
建议文件名使用纯英文名称。
来源:hxxps://tieba.baidu.com/p/7691727191 |
|