Page 1 of 1 1
Topic Options
#32210 - 2002-11-12 08:56 AM Copy to Desktop
ladybird Offline
Fresh Scripter

Registered: 2002-08-11
Posts: 19
I am trying to copy some shortcut which i created through ADDPROGRAMGROUP and synchronise to Desktop by creating same folder

Shell '%comspec% /c MD "%USERPROFILE%\Desktop\Application Folder"'
Shell '%comspec% /c COPY "%USERPROFILE%\Start Menu\Programs\Application Folder\*.*" "%USERPROFILE%\Desktop\Application Folder\*.*"'

My questions:
1. Is there better way?
2. How can I change the folder icon to something else?

Thanks in advance

Top
#32211 - 2002-11-12 09:09 AM Re: Copy to Desktop
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you could create the shortcuts directly to that folder with udf's foundable in our udf-forum.
checking from www.gwspikval.com/jooel/UDF gives at least:
shortcut()
softlink()
wshshortcut()
_________________________
!

download KiXnet

Top
#32212 - 2002-11-12 02:59 PM Re: Copy to Desktop
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
You should also read our great FAQ collection, especially Copy a shortcut to the Desktop, Start Menu, etc. . And use native KiXtart commands/functions wherever possible instead of SHELLing out.
_________________________
There are two types of vessels, submarines and targets.

Top
#32213 - 2002-11-12 04:04 PM Re: Copy to Desktop
ladybird Offline
Fresh Scripter

Registered: 2002-08-11
Posts: 19
Correct me if i am wrong. I see all the link that you have given to me, it's creating shortcut one by one.

It means that i should create one line of code for each shortcut.

For my case, i just put my code at the bottom of my script, it will copy whatever shortcut which is created by ADDPROGRAMGROUP earlier.

Please advise me on this

Is there any disadvantage of using shell command?

Thanks

Top
#32214 - 2002-11-12 04:08 PM Re: Copy to Desktop
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
There are different ways to accomplish the same task. However, it is never good to hardcode stuff like the Desktop folder. Your script would for example not work under Windows 9x.

Why SHELL out if there's a KiXtart command for it? Definitley less overhead and slightly faster.
_________________________
There are two types of vessels, submarines and targets.

Top
#32215 - 2002-11-12 06:10 PM Re: Copy to Desktop
ladybird Offline
Fresh Scripter

Registered: 2002-08-11
Posts: 19
Alright, i am getting understand. Just another a few questions. I need to create the shortcut on the specific folder on desktop. That folder will contain all the shortcut.

I won't use shortcut() UDF, because it use another program (shortcut.exe). For wshshortcut(), I believe all workstation should install with WSH program. Am I right?

$desktop = READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Common Desktop")copy "Yourshortcut.LNK" $desktop

This code is only for existing folder. I can't point to new specific folder e.g Application folder.

Softlink() UDF, it might work. I will test it. I am new in Kixtart, and not sure how to run by using UDF.

Top
#32216 - 2002-11-12 06:14 PM Re: Copy to Desktop
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
See How to use UDFs
_________________________
There are two types of vessels, submarines and targets.

Top
#32217 - 2002-11-13 04:37 AM Re: Copy to Desktop
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Well, if you aren't averse to using WSH you can give this a try to get your 'special folder' variables...

code:
$objWshShell = CreateObject("WScript.Shell")
$sDesktop = $objWshShell.SpecialFolders("Desktop")
$sDesktop ?


Top
#32218 - 2002-11-13 05:37 AM Re: Copy to Desktop
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Here, I even turned it into a UDF for you... fnGetSpecialFolder()
Top
#32219 - 2002-11-13 05:52 AM Re: Copy to Desktop
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Not bad Chris... thanks for feeding the kitty.
Top
#32220 - 2002-11-15 02:52 AM Re: Copy to Desktop
ladybird Offline
Fresh Scripter

Registered: 2002-08-11
Posts: 19
I guess i found what i want. I just use showprogramgroup command.

It works. So, the user just refer to this program group for any shortcut rather on desktop.

Thanks all of you!!!

Top
#32221 - 2002-11-15 01:48 PM Re: Copy to Desktop
ladybird Offline
Fresh Scripter

Registered: 2002-08-11
Posts: 19
I thought it's successful.

I am using this code:

IF ShowProgramGroup("Application Folder", 5, 0) = 0
SHOWPROGRAMGROUP("Application Folder",6,0)
ENDIF

The result is not consistent. How can I keep the window always active?

[ 15. November 2002, 14:48: Message edited by: ladybird ]

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.118 seconds in which 0.051 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org