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-04 02:24
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Homemade batch file for automatically changing the startup sound at boot, if it's good please bump it~ View 832 Replies 7
Original Poster Posted 2007-04-05 11:31 ·  中国 安徽 蚌埠 电信
中级用户
★★
Credits 292
Posts 137
Joined 2007-04-03 01:59
19-year member
UID 83758
Gender Male
Status Offline
Hehe, I had nothing to do so I wrote a batch file myself. It can make the startup sound change every time the machine boots.
Because what I've learned is still limited, it only works on systems whose system drive is C:, I'll improve it later.
Some of the code in it modifies the registry. If antivirus software gives a warning, everyone can rest assured and modify it.
(Anyone who wants to learn is welcome to look at my code)

Installation process:
First back up the original sound file
Create the target folder
Copy in the required program files
Modify the registry

An uninstall program is included, which can unregister the registry entries and completely delete this program

Hope to get to know more batch file experts, hehe, I can't improve myself any further on my own....
Everyone is welcome to give more suggestions, qq:448045169

File address:http://zhenlove.com.cn/cndos/fileup/files/MusicAutoChange_HY.rar

Absolutely virus-free, product certified

[ Last edited by bw070 on 2007-4-5 at 12:24 AM ]
Floor 2 Posted 2007-04-05 15:51 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
Originally posted by bw070 at 2007-4-5 11:31:
Hehe, I had nothing to do so I wrote a batch file myself. It can make the startup sound change every time the machine boots.
Because what I've learned is still limited, it only works on systems whose system drive is C:, I'll improve it later.
Some of the code in it modifies the regis ...


What is this thing? It's 5.59M,
It's clearly a REG file, so why disguise it as a DLL (a typical virus move)? And with that you're welcoming people to view the source code?
Also, why not try modifying the registry instead (untested, check it yourself): HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\WindowsLogon
the value of %SystemRoot%\media\Windows XP 登录音.wav instead? (login sound 1, login sound 2......) That saves backing up files and also saves you from constantly replacing files

[ Last edited by baomaboy on 2007-4-5 at 04:16 PM ]
Floor 3 Posted 2007-04-06 01:46 ·  中国 甘肃 平凉 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Actually this isn't hard to do, is it?
Floor 4 Posted 2007-04-06 01:47 ·  中国 安徽 蚌埠 电信
中级用户
★★
Credits 292
Posts 137
Joined 2007-04-03 01:59
19-year member
UID 83758
Gender Male
Status Offline
It's clearly a REG file, so why disguise it as a DLL (a typical virus move)? And with that you're welcoming people to view the source code?

To the poster above, if you open the DLL file with Notepad, you can see that it's a registry file.
What you said isn't wrong, but if you call it a virus, then I can only say you don't know enough.
The method you gave is very good and can change the startup sound, but I haven't tried it.
Hope someone who understands the registry can come help clear this up.

Now let me explain the files.

no1_newrun.dll

Windows Registry Editor Version 5.00


"MusicAutoChange"="C:\\WINDOWS\\system\\auto_change_music\\auto_C2_music.bat"

------------------------------------------------------------

no2_newrun.dll

Windows Registry Editor Version 5.00


"MusicAutoChange"="C:\\WINDOWS\\system\\auto_change_music\\auto_C3_music.bat"

------------------------------------------------------------

no3_newrun.dll

Windows Registry Editor Version 5.00


"MusicAutoChange"="C:\\WINDOWS\\system\\auto_change_music\\auto_C1_music.bat"

-----------------------------------------------------------

del_run.dll

Windows Registry Editor Version 5.00


"MusicAutoChange"=-

The functions of no1_newrun.dll, no2_newrun.dll, and no3_newrun.dll are to set the three batch files as startup items.

The function of del_run.dll is to delete the startup item.

After each startup, it deletes the original sound file, copies in the new sound file, and then modifies the startup item.
auto_C1_music.bat→auto_C2_music.bat→auto_C3_music.bat→loop

If this counts as a virus, then I have nothing to say. If you don't test it yourself, why say it's a virus?
You wouldn't use a batch file to write a virus anyway, would you?

[ Last edited by bw070 on 2007-4-5 at 12:49 PM ]
Floor 5 Posted 2007-04-06 01:51 ·  中国 安徽 蚌埠 电信
中级用户
★★
Credits 292
Posts 137
Joined 2007-04-03 01:59
19-year member
UID 83758
Gender Male
Status Offline
As for why it's over 5M, it's because the 3 sound files are each a little over 1M on average.
The main program is only 20K.
I only wrote it for everyone for fun. If there are other ways to do it, then of course that's even better.
But please, don't just call it a virus all the time, okay~~
If the poster in reply #2 comes back, please post that registry-modification method for sound 1, sound 2.
I'd like to learn it.

[ Last edited by bw070 on 2007-4-5 at 12:56 PM ]
Floor 6 Posted 2007-04-06 02:55 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
Originally posted by bw070 at 2007-4-6 01:47:
It's clearly a REG file, so why disguise it as a DLL (a typical virus move)? And with that you're welcoming people to view the source code?

To the poster above, if you open the DLL file with Notepad, you can see that it's a registry file.
What you said isn' ...


I don't know much, that's true, can't help it.
I didn't say yours was a virus. By "(a typical virus move)" I meant that viruses use this method to hide themselves. Since you know a lot, of course you understand what DLL files are for, but do you really think everyone is going to play hide-and-seek with you and use Notepad to inspect it?
Also, if you already know how to modify Run, then changing that login sound value is even simpler, isn't it? Can't you do it yourself? I'm not very interested in login sounds, so I still haven't tested it. I'll leave it for you to experiment with!
And how did you get the idea that you can't write viruses with batch files? Haven't you seen batch file viruses? Looks like you're just like me and don't know that much either. Search for "ypshashou" and see ^_^ Dangerous, better not tell you too much, in case you get hit by it

[ Last edited by baomaboy on 2007-4-6 at 05:47 AM ]
Floor 7 Posted 2007-04-06 03:08 ·  中国 广西 玉林 电信
初级用户
Credits 48
Posts 32
Joined 2007-02-28 23:26
19-year member
UID 80423
Gender Male
Status Offline
Floor 8 Posted 2007-04-06 03:27 ·  中国 安徽 蚌埠 电信
中级用户
★★
Credits 292
Posts 137
Joined 2007-04-03 01:59
19-year member
UID 83758
Gender Male
Status Offline
Hehe, everyone don't get mad.
I just reworked it again. If someone likes different startup sounds, then you can use it without worry.
If you don't like it or have doubts, then just don't use it. Very simple.

Using a batch file to modify the registry is just one function of P. You can use a command
to directly import a .reg file into the registry.
You can also write the .reg file into a dll and use the command
regedit -s ???.dll
The two have the same effect. If a car is faster than a bicycle, why not use the car?

In a moment I'll make another post and modify that program a bit.

Removed the DOS window flashing at startup
Forum Jump: