Unable to close unsaved notepad

in my workflow, after issuing a close application on Notepad.exe , I get option window to either save or don’t save window . Here i’m using click activity to choose don’t save . however , bot is not able to recognize donot save button and fails .
Am I doing something wrong here ?

Hello, maybe it’s your selector or more easy just use invoke powershell to kill all notepads. You can just search that activity and use the following comand: taskkill /IM “notepad.exe” /F

Just make sure to check isscrip and put string in type of argument like in my image. Try it.

Hi,

I suppose there are 2 options to solve this matter

  1. Use Close Window Activity instead of Close Application Activity.

  2. Use Parallel Activity and set Click Activity for “dont save” and Close Application Activity, into it.

Can you try above?

Regards,

Yoichi

Thank you. But I’m getting the below error message while executing the power shell command . this command is working fine on command prompt but in Uipath Studio … I’m getting this below error . … Any idea … why i’m getting this exception ?

19.7.0+Branch.master.Sha.8c253d13718eed5c7db27daef6facd1fe1b0d067

Source: Invoke Power Shell (Throw)

Message: The term ‘taskkill /IM “notepad.exe” /F’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Exception Type: System.Management.Automation.CommandNotFoundException

RemoteException wrapping System.Management.Automation.CommandNotFoundException: The term ‘taskkill /IM “notepad.exe” /F’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
at UiPath.Core.Activities.ScopeActivity.OnFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

I had already tried both Close window and Close application but none had worked . I just used the parallel option and its working fine now . Thank you very much .

Follow my instructions and it will work.


Also I suggest putting in ContinueOnError to True in case notepad is close it doesn’t fail.

1 Like

Excellent ! It worked . Thanks a lot for your Assistance . It really helped me in learning to use Power shell commands in UiPath .

1 Like

Thanks for the solution.

Hi there! I have found that putting a ‘Get Active Window’ activity and performing the click inside there works.

1 Like

@krees_m_23 thanks. this is my preferred solution. Use “Close Window” instead of “Close Application”