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-11 02:36
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Closed] Create a shortcut of the startup file in a software to the desktop View 1,618 Replies 9
Original Poster Posted 2008-12-07 09:00 ·  中国 江西 九江 电信
新手上路
Credits 16
Posts 10
Joined 2007-05-28 19:31
19-year member
UID 89585
Gender Male
Status Offline
A green software. Write a batch file and place it in the software file:

start 绿化.exe
regedit /s xxx.reg
start 程序.exe

How to further shortcut the icon and name of this program to the desktop

───────────────── Moderation Records ─────────────────
Performed by: HAT
Operation: Added search keywords in the post title
Explanation: The original title " Help write a batch file" is not conducive to forum search
Punishment: Deducted 2 points
Tip: It is recommended to read the following posts
{1415}The Wisdom of Asking Questions
{7326}Must-read for Forum Newcomers, Basic Code of Conduct for Everyone
{22703}Please Don't Be an Impatient Person
{32667}Those Who Can't Even Write a Clear Title, Wake Up
{32825}This Board Severely Rectifies Poor Posts
───────────────── Moderation Records ─────────────────


[ Last edited by HAT on 2008-12-11 at 19:35 ]
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
HAT -2 2008-12-07 11:45
Floor 2 Posted 2008-12-07 11:22 ·  中国 湖北 武汉 中国科学院研究生院玉泉教学楼
银牌会员
★★★
Credits 1,187
Posts 555
Joined 2006-12-21 07:35
19-year member
UID 74129
Gender Male
Status Offline
@echo off
rem Enter the target folder, check for shortcuts and copy
dir x:\mulu|find ".lnk"&&copy a.lnk "%userprofile%\desktop"
Or the Chinese version "Desktop"
dir x:\mulu|find ".lnk"&&copy abc.lnk "%userprofile%\desktop"
Floor 3 Posted 2008-12-07 20:54 ·  中国 广东 广州 电信
初级用户
★★
l i u s s
Credits 73
Posts 101
Joined 2008-09-17 00:21
17-year member
UID 125825
Gender Male
From GZ
Status Offline
Batch processing:

@echo off
set a="c:\green\1.exe"
set b="c:\green\2.exe"
set c="c:\green\3.exe"

echo >"%userprofile%\Desktop\1.url"
echo URL=%a% >>"%userprofile%\Desktop\1.url"
echo IconIndex=0 >>"%userprofile%\Desktop\1.url"
echo IconFile=%a% >>"%userprofile%\Desktop\1.url"

echo >"%userprofile%\Desktop\2.url"
echo URL=%b% >>"%userprofile%\Desktop\2.url"
echo IconIndex=0 >>"%userprofile%\Desktop\2.url"
echo IconFile=%b% >>"%userprofile%\Desktop\2.url"

echo >"%userprofile%\Desktop\3.url"
echo URL=%c% >>"%userprofile%\Desktop\3.url"
echo IconIndex=0 >>"%userprofile%\Desktop\3.url"
echo IconFile=%c% >>"%userprofile%\Desktop\3.url"


VBScript:

'Create a shortcut for the QQ program on the desktop
Set WshShell = WScript.CreateObject("Wscript.Shell")
strFolder = WshShell.SpecialFolders("Desktop") 'Set the directory where the shortcut goes
set oShellLink = WshShell.CreateShortcut(strFolder & "\Tencent QQ.lnk") 'Absolute path and name of the shortcut
oShellLink.TargetPath = "D:\Program Files\Tencent\QQ\QQ.exe" 'The target program that the shortcut points to
oShellLink.WindowStyle = 1 'The running mode of the pointed program (1 normal window, 3 maximize, 7 minimize)
oShellLink.Hotkey = "Alt+Q" 'Set the hotkey
oShellLink.IconLocation = "D:\Program Files\Tencent\QQ\QQ.exe, 0" 'The location of the icon file
oShellLink.Description = "" 'Description of the shortcut
oShellLink.WorkingDirectory = "D:\Program Files\Tencent\QQ\" 'The starting location of the shortcut (points to the directory where the program is located)
oShellLink.Save

'Explanation of the directory where the shortcut goes:
'Desktop desktop directory
'Startmenu start menu directory
'Programs program menu directory
'StartUp program startup directory
'Favorites favorites directory
'SendTo send to directory


[ Last edited by newxso on 2008-12-9 at 21:02 ]
Floor 4 Posted 2008-12-08 17:44 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
Originally posted by newxso at 2008-12-7 20:54:
@echo off
set a="c:\green\1.exe"
set b="c:\green\2.exe"
set c="c:\green\3.exe"

echo >"%userprofile%\桌面\1.url"
echo URL=%a% & ...


Shouldn't the shortcut of the program be created like this? Have you ever used it yourself?

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 5 Posted 2008-12-08 19:16 ·  中国 广西 百色 中移铁通
银牌会员
★★★
永远的菜鸟
Credits 1,335
Posts 574
Joined 2007-11-27 12:50
18-year member
UID 103929
Gender Male
From 广西
Status Offline
Originally posted by yishanju at 2008-12-8 17:44:


The shortcut of the program shouldn't be created like this, right?
Have you ever used it yourself?

Take a look here?
Four Methods to Create Shortcuts with Batch Processing
Floor 6 Posted 2008-12-09 17:16 ·  中国 山东 济南 联通
高级用户
★★★
Credits 959
Posts 474
Joined 2007-10-25 10:40
18-year member
UID 100716
Gender Male
Status Offline
To create a real shortcut, you need to use VBS
Floor 7 Posted 2008-12-11 17:53 ·  中国 江西 九江 电信
新手上路
Credits 16
Posts 10
Joined 2007-05-28 19:31
19-year member
UID 89585
Gender Male
Status Offline
A green software. Write a batch file and place it in the software files:

start 绿化.exe
regedit /s xxx.reg
start xxx.exe

How to further shortcut the icon and name of this program to the desktop

I didn't succeed with the above method, please give me some guidance
Floor 8 Posted 2008-12-11 18:14 ·  中国 江西 九江 电信
新手上路
Credits 16
Posts 10
Joined 2007-05-28 19:31
19-year member
UID 89585
Gender Male
Status Offline
The shortcut was successful. But the shortcut program can't be launched.
Floor 9 Posted 2008-12-11 18:46 ·  中国 黑龙江 大庆 大庆中基石油通信建设有限公司
高级用户
★★
Credits 547
Posts 261
Joined 2006-04-15 16:50
20-year member
UID 53887
Status Offline
Originally posted by jjttefg at 2008-12-11 18:14:
The shortcut was successful. But the shortcut program can't be started when clicked.

Try this. I created a shortcut for notepad.exe.

@echo off
echo >>a.url
echo URL=c:\windows\notepad.exe >>a.url
rem echo URL=http://10.64.240.131 >>a.url
echo IconIndex=20 >>a.url
echo IconFile=C:\windows\system32\shell32.dll >>a.url
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
HAT +2 2008-12-11 19:35
Floor 10 Posted 2008-12-11 19:00 ·  中国 江西 九江 电信
新手上路
Credits 16
Posts 10
Joined 2007-05-28 19:31
19-year member
UID 89585
Gender Male
Status Offline
Thank you very much. It worked.
Forum Jump: