Have a small bash script which I would like to put it into a method in ruby the script content is as follows.
def test_method
`@echo off`
`SETLOCAL ENABLEDELAYEDEXPANSION`
`SET LinkName=Projects`
`SET Esc_LinkDest=%userprofile%\Links\!LinkName!.lnk`
`SET Esc_LinkTarget=C:\Projects`
`SET cSctVBS=CreateShortcut.vbs`
`SET LOG=".\%~N0_runtime.log"`
`((`
`echo Set oWS = WScript.CreateObject^("WScript.Shell"^)`
`echo sLinkFile = oWS.ExpandEnvironmentStrings^("!Esc_LinkDest!"^)`
`echo Set oLink = oWS.CreateShortcut^(sLinkFile^)`
`echo oLink.TargetPath = oWS.ExpandEnvironmentStrings^("!Esc_LinkTarget!"^)`
`echo oLink.Save`
`)1>!cSctVBS!`
`cscript //nologo .\!cSctVBS!`
`DEL !cSctVBS! /f /q`
`)1>>!LOG! 2>>&1`
end
It executes till (( i.e line number 8 and gives me the error No such file or directory - ((
That part in the bash script is something which I am writing some content to a file.
Just want to execute that method and make it work like if I had written the same content in a bat file it works absolutely fine.