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-01 20:06
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] How to achieve automatic execution of scripts at boot in Group Policy View 2,076 Replies 4
Original Poster Posted 2006-06-11 12:17 ·  IANA 局域网IP(Private-Use)
新手上路
Credits 14
Posts 3
Joined 2006-06-06 23:18
20-year member
UID 56665
Gender Male
Status Offline
My system is XP. I want to use a script to create an.ini file to implement the function of automatically executing the script at startup in Group Policy. But the text of the.ini file written by echo something >1.ini has all become garbled due to different encoding mechanisms. While first using echo something >1.txt and then renaming it to 1.ini, the text is the same when opened. And after placing it in C:\WINDOWS\system32\GroupPolicy\Machine\Scripts, I can see the file I added in the Group Policy Editor, but the system does not execute it.
How should I solve this? Please ask all the experts for guidance.

[ Last edited by willsort on 2006-6-14 at 16:54 ]
Floor 2 Posted 2006-06-11 13:09 ·  中国 湖北 荆门 电信
荣誉版主
★★★
Credits 2,013
Posts 718
Joined 2006-02-18 07:07
20-year member
UID 50550
Status Offline
In my previous tests (xp sp1), simply adding an ini file cannot achieve the purpose of starting up at boot. Generally, modifying the registry directly works much better for this kind of self-startup method.


Windows Registry Editor Version 5.00


"Script"="C:\\Documents and Settings\\Administrator\\Desktop\\myscript.bat"
"Parameters"=""


After adding the startup here, not only can't it be viewed with msconfig, but even wmic startup can't find its trace. My previous method was using Gpresult /v | findstr "Name" |findstr /v "Site" | findstr /v "Domain" (the test environment was sp1 at that time, and the method of using two findstrs was quite funny). In fact, as long as you check whether there are Startup or shutdown under scripts in the registry, you can know whether there are scripts that start up at boot or run at shutdown.
Floor 3 Posted 2006-06-11 23:34 ·  IANA 局域网IP(Private-Use)
新手上路
Credits 14
Posts 3
Joined 2006-06-06 23:18
20-year member
UID 56665
Gender Male
Status Offline
Thanks, moderator. I'll test it when I have time. :)
I really don't know how many methods for self-startup I still don't know, heh heh
Floor 4 Posted 2006-06-14 16:54 ·  中国 山西 太原 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline

───────────────── Moderation Record ─────────────────
Performed by: Will Sort
Operation: Modify Title - Help with methods to modify ini files~~~
───────────────── Moderation Record ─────────────────
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 5 Posted 2006-06-15 20:02 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
3742668:
Is it effective in WIN2000? There is no State under [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\! What should I do?
Forum Jump: