China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-09 16:21
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How can I use a batch file to make a drive background image? View 747 Replies 3
Original Poster Posted 2008-08-27 21:53 ·  中国 江苏 苏州 昆山市 电信
初级用户
★★
Credits 133
Posts 75
Joined 2008-08-03 01:08
18-year member
UID 122677
Gender Male
Status Offline
Hope for a reply, thanks
Floor 2 Posted 2008-08-27 22:24 ·  中国 重庆 巫山县 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
@echo off
rem Just drag and drop the image onto this batch file
set CurPath=%~dp0
set CurPath=%CurPath:~0,-1%
attrib +s "%CurPath%"
del /arsh "%~dp0desktop.ini" >nul 2>nul
>"%~dp0desktop.ini" echo
>>"%~dp0desktop.ini" echo
>>"%~dp0desktop.ini" echo IconArea_Image=%1
>>"%~dp0desktop.ini" echo IconArea_Text=0x000000ff
attrib +h +r +s "%~dp0desktop.ini"
taskkill /f /im explorer.exe
start explorer.exe
Floor 3 Posted 2008-08-27 22:35 ·  中国 江苏 苏州 昆山市 电信
初级用户
★★
Credits 133
Posts 75
Joined 2008-08-03 01:08
18-year member
UID 122677
Gender Male
Status Offline
Thanks for the prompt reply.
Floor 4 Posted 2008-08-27 22:58 ·  中国 江苏 苏州 昆山市 电信
初级用户
★★
Credits 133
Posts 75
Joined 2008-08-03 01:08
18-year member
UID 122677
Gender Male
Status Offline
Let me upgrade the question a bit: prompt for a drive letter, then set the background for that corresponding drive.

How should that be written.?

I can understand the code above, but I still can't write the batch file for my own question.

No choice, so I'm asking for some code again.
Forum Jump: