保存为bat格式 选ANSI格式
::以下是代码
<# :
@璐村惂鐢ㄦ埛_000076K馃惥 off
mode concols=50 lines=16
echo.
echo 拖入图片:
echo.
set/p l=
echo.
powershell "Invoke-command ([ScriptBlock]::Create([io.file]::ReadAllText('%~f0',[Text.Encoding]::Default)))" 2>nul 1>nul
echo 完成
pause>nul
#>
function Set-Wallpaper($l){Add-Type @"
using System;using System.Runtime.InteropServices;
public class Params{[DllImport("User32.dll")]public static extern int
SystemParametersInfo(Int32 uAction,Int32 uParam,String lpvParam,Int32 fuWinIni);}
"@
[Params]::SystemParametersInfo(0x0014, 0, $l, 0x01 -bor 0x02)}
Set-WallPaper "$env:l"
::以下是代码
<# :
@璐村惂鐢ㄦ埛_000076K馃惥 off
mode concols=50 lines=16
echo.
echo 拖入图片:
echo.
set/p l=
echo.
powershell "Invoke-command ([ScriptBlock]::Create([io.file]::ReadAllText('%~f0',[Text.Encoding]::Default)))" 2>nul 1>nul
echo 完成
pause>nul
#>
function Set-Wallpaper($l){Add-Type @"
using System;using System.Runtime.InteropServices;
public class Params{[DllImport("User32.dll")]public static extern int
SystemParametersInfo(Int32 uAction,Int32 uParam,String lpvParam,Int32 fuWinIni);}
"@
[Params]::SystemParametersInfo(0x0014, 0, $l, 0x01 -bor 0x02)}
Set-WallPaper "$env:l"