#43073 - 2003-07-19 10:46 PM
Copy command
|
kdm
Fresh Scripter
Registered: 2001-10-25
Posts: 31
Loc: Harrisburg, PA
|
Kixtart 4.11, 4.21 (tried this with both)
I'm trying to copy a shortcut from the scripts folder to the C:\ drive. The first line below is in my script but it doesn't copy and no errors are displayed. copy @lserver+"\netlogon\shortcuts\shortcut.lnk" "C:\"
I then told it to print to the screen and the source path and destination path all run together. Any ideas why this would happen?
This is the output: \\server\netlogon\shortcuts\Shortcut.lnkC:\
|
|
Top
|
|
|
|
#43075 - 2003-07-19 10:51 PM
Re: Copy command
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
|
|
Top
|
|
|
|
#43076 - 2003-07-19 10:55 PM
Re: Copy command
|
kdm
Fresh Scripter
Registered: 2001-10-25
Posts: 31
Loc: Harrisburg, PA
|
$w2kDesktop = "C:\Documents and Settings\All Users\Desktop" $w9xDesktop = "c:\windows\all users\desktop" if exist ($w2kDesktop) copy @lserver+"\netlogon\shortcuts\Psynet(New Server).lnk" $w2kDesktop ? @lserver+"\netlogon\shortcuts\Psynet(New Server).lnk" $w2kDesktop else copy @lserver+"\netlogon\shortcuts\Psynet(New Server).lnk" $w9xDesktop endif [ 19. July 2003, 22:56: Message edited by: kdm ]
|
|
Top
|
|
|
|
#43079 - 2003-07-19 11:10 PM
Re: Copy command
|
kdm
Fresh Scripter
Registered: 2001-10-25
Posts: 31
Loc: Harrisburg, PA
|
Here is my new code: $Source = @lserver+'\netlogon\shortcuts\Psynet(New Server).lnk' $w2kDesktop = 'C:\' $w9xDesktop = 'C:\' if exist ($w2kDesktop) copy $source $w2kDesktop ? "Windows 2000" ? $source $w2kDesktop ? 'Error '+@ERROR+' - '+@SERROR else copy $ Source $w9xDesktop ? "Windows 9x" endif
Here is the output with error: Windows 2000 \\server\netlogon\shortcuts\Psynet(New Server).lnkC:\ Error 2 - The system cannot find the file specified.
|
|
Top
|
|
|
|
#43081 - 2003-07-19 11:15 PM
Re: Copy command
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Your output error is caused by not including a space.
? $source + " " + $w2kDesktop
Your file not found problem is something you will have to resolve by using the correct path and filename of an existing file. [ 19. July 2003, 23:17: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#43082 - 2003-07-19 11:21 PM
Re: Copy command
|
kdm
Fresh Scripter
Registered: 2001-10-25
Posts: 31
Loc: Harrisburg, PA
|
I tried including the space (copy $source + " " + $w2kDesktop) and I receive this error: ERROR : Error in expression.! Script: C:\WINNT\SYSVOL\sysvol\domain\scripts\training.kix Line : 5
I think the reason I get the file not found error is bacuase of the space not being included. This is driving me crazy! I do appreciate the help though. Ecspecially on a Saturday.
Any other ideas?
|
|
Top
|
|
|
|
#43084 - 2003-07-19 11:47 PM
Re: Copy command
|
kdm
Fresh Scripter
Registered: 2001-10-25
Posts: 31
Loc: Harrisburg, PA
|
Thanks for all your help I just realized the shortcut I was trying to copy has an extension of .url and not .lnk. Time to drink a few beers!!
|
|
Top
|
|
|
|
#43085 - 2003-07-20 04:31 PM
Re: Copy command
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
You can establish where the Desktop, Start Menu, etc. is located at, for example -
code:
$dt=READVALUE('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders','Common Desktop')
Have a look at -
KiXtart FAQ & How to's
Copy a shortcut to the Desktop, Start Menu, etc.
HTH,
Kent
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1188 anonymous users online.
|
|
|