Set objFSO=CreateObject("Scripting.FileSystemObject")
Set objTFile=objFSO.CreateTextFile("C:\test\Test.txt")
SystemUtil.Run "C:\test\Test.txt"
Window("Notepad").Activate
Window("Notepad").Type micCtrlDwn "v" micCtrlUp
wait 3Window("Notepad").Type micCtrlDwn "s" micCtrlUp
systemUtil.CloseProcessByName "C:\test\Test.txt"
Set objfileToread=objFSO.OpenTextFile("C:\test\Test.txt",1)fileText=objfileToread.ReadAll()
.................................................................................................
I am getting an error that this process is accessed by another service at "Window("Notepad").Type micCtrlDwn "s" micCtrlUp" step. But when I run the following code it gets executed successfully.
................................................................................................
Set objFSO=CreateObject("Scripting.FileSystemObject")SystemUtil.Run "C:\test\Test.txt"
Window("Notepad").Activate
Window("Notepad").Type micCtrlDwn "v" micCtrlUp
wait 3Window("Notepad").Type micCtrlDwn "s" micCtrlUp
systemUtil.CloseProcessByName "C:\test\Test.txt"
Set objfileToread=objFSO.OpenTextFile("C:\test\Test.txt",1)fileText=objfileToread.ReadAll()