Using Ruby 1.9.3 on Windows Vista
In trying example_shortcut.rb I kept getting Encoding errors. I got past this by adding .encode("UTF-8")
to Dir::DESKTOP and Dir::WINDOWS
e.g. Dir::WINDOWS.encode("UTF-8")
I also found that the line:
s.path = "c:\\" << Dir::WINDOWS.encode("UTF-8") << "\\notepad.exe"
added an extra c:\ at the start of the string -- which caused a 'method not found' error in the underlying shortcut.rb
line 138. Removing the extra c:\ got rid of the problem. (I don't know if the extra c:\ is present for older Ruby
or Windows.)
With the above changes I was able to create a shortcut.
If my fixes are appropriate, could someone please add them to the code base.
Thanks
Harrison |