[Win32utils-devel] [ win32utils-Bugs-2093 ] unable to open existing shortcut

noreply at rubyforge.org noreply at rubyforge.org
Fri Jul 8 04:43:13 EDT 2005


Bugs item #2093, was opened at 2005-07-08 04:43
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=411&aid=2093&group_id=85

Category: win32-shortcut
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Nobody (None)
Assigned to: Nobody (None)
Summary: unable to open existing shortcut

Initial Comment:
#
## My RUBY version
#
C:\>ruby -v
ruby 1.8.2 (2004-12-25) [i386-mswin32]

#
## Shortcut execution log with error
#
C:\>ruby M:\CDD\ruby\win32\shortcut\bug.rb
Version: 0.1.3
Link C:/test.lnk created
M:/CDD/ruby/win32/shortcut/bug.rb:22:in `open': The system cannot find the file
specified. (Win32::ShortcutError)
        from M:/CDD/ruby/win32/shortcut/bug.rb:22

#
## Test script
#
=== M:\CDD\ruby\win32\shortcut\bug.rb ===
#!/usr/bin/ruby
require 'win32/shortcut'
include Win32

puts "Version: " + Shortcut::VERSION

link = 'C:/test.lnk'
File.delete(link) if File.exists?(link)

s = Shortcut.new(link)
s.description = "test link"
s.path = 'c:\winnt\notepad.exe'
s.show_cmd = Shortcut::SHOWNORMAL
s.working_directory = "C:\"
s.save

fail "LNK creation failed: #{link}" unless File.exists?(link)

puts "Link #{link} created"

s = Shortcut.open(link)
puts "Path: #{s.path}"
__END__


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

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=411&aid=2093&group_id=85


More information about the win32utils-devel mailing list