Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/ruby
- # path settings
- local='/home/jan/';
- invm='Z:\\';
- username="Jan"
- machine="Windows XP"
- # get full path of file to open
- toopen = File.expand_path(ARGV[0])
- # check if its in the right path
- if toopen[0..local.length-1] != local
- $stderr.puts "Error: #{toopen} is not in #{local}"
- exit 1
- end
- # assemble Windows path
- winpath = invm + toopen[local.length..toopen.length]
- winpath.gsub!("/","\\")
- # now call it
- `VBoxManage guestcontrol execute \"#{machine}\" \"c:\\windows\\system32\\rundll32.exe\" --arguments \"dummy url.dll,FileProtocolHandler #{winpath} \" --username \"#{username}\"`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement