Forum Discussion
15 Replies
Hi Yehuda,
Modify your script in the following way:
Sub ChangeASaMenuPath ()
Dim Application
Dim os64bits
Dim aSaMenu
os64bits = Sys.OSInfo.Windows64bit
Set aSaMenu = TestedApps.aSaMenu
If os64bits Then
aSaMenu.Path = Replace(aSaMenu.Path,"Program Files","Program Files (x86)")
Else
aSaMenu.Path = Replace(aSaMenu.Path,"Program Files (x86)","Program Files")
End If
End Sub- QAPittOccasional ContributorThanks David and everyone else for your help. That last post by David with the VBScript works exactly the way I was hoping!
- QAPittOccasional ContributorDavid,
Is there a way to run that as a code snippet at the beginning of a keyword test? or should i just call it using the Run Script Routine? - QAPittOccasional ContributorFYI, I changed your code slightly because on a 64 bit environment when the Else statement took place it was changing "Program Files (x86)" to "Program Files (x86) (x86)" etc.
Here is the final version of the code I came up with:
Sub ChangeASaMenuPath ()
Dim Application
Dim os64bits
Dim aSaMenu
os64bits = Sys.OSInfo.Windows64bit
Set aSaMenu = TestedApps.aSaMenu
If (os64bits = True) And aSaMenu.Path = "C:\Program Files\aSa\CI\" Then
aSaMenu.Path = Replace(aSaMenu.Path,"Program Files","Program Files (x86)")
End If
If (os64bits = False) And aSaMenu.Path = "C:\Program Files (x86)\aSa\CI\" Then
aSaMenu.Path = Replace(aSaMenu.Path,"Program Files (x86)","Program Files")
End If
End Sub
Thanks again for all the help. 
Hi Yehuda,
You need to use Run Script Routine as the routine contains more than one line of code.