I am trying to do a simple clean up step that removes the previous version before installing the new version. All I am doing is opening CMD, issuing the command: "rmdir /s /q .\install "
Sometimes it does, sometimes I get Access Denied on the EXE and 6 .dll files. I can run the command by hand and it works, I am running CMD as admin, I even moved this step to the start of the suite rather the end in case files were in use. All I am trying to do is delete the "install" directory and sub directories so the next run will install a new build in it's place as overwriting causes other issues.
command line action doesn't always work.
-
- Posts: 102
- Joined: Fri Nov 08, 2019 3:23 pm
Re: command line action doesn't always work.
Hi,
I guess that if it "sometimes" works, you will get the same result also if the same CMD is called manually (just give it few tries)? Access Denied means that the app you trying to uninstall is most probably still in use? So, before issuing uninstall command, you should make sure the uninstalled app is really terminated. The best would be to search for the process name and eventually kill it before calling uninstall?
I guess that if it "sometimes" works, you will get the same result also if the same CMD is called manually (just give it few tries)? Access Denied means that the app you trying to uninstall is most probably still in use? So, before issuing uninstall command, you should make sure the uninstalled app is really terminated. The best would be to search for the process name and eventually kill it before calling uninstall?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 102
- Joined: Fri Nov 08, 2019 3:23 pm
Re: command line action doesn't always work.
This is why I moved it from the end of the script to the start.
Currently, the script uninstalls first, so the machine is not running the app and likely hasn't for some time. So it shouldn't be in use, or loaded into memory. I had a minute long post shut down wait, but it still happened. This is why I moved it to first step.
I thought the most reliable way to delete this directory would be from the command line, but this is proving me to be incorrect in that assumption.
Currently, the script uninstalls first, so the machine is not running the app and likely hasn't for some time. So it shouldn't be in use, or loaded into memory. I had a minute long post shut down wait, but it still happened. This is why I moved it to first step.
I thought the most reliable way to delete this directory would be from the command line, but this is proving me to be incorrect in that assumption.
Re: command line action doesn't always work.
Hi,
I must have been blind while reading your initial post
I just noticed that you are trying to use simple rmdir command. What version of Windows do you use? The Access Denied error could be issued also in case the directory was created with different user account than you are using while deleting! What you can try is to run the test (whole Studio) as administrator. Another possibility could be killing explorer.exe process, but it's kind of dirty and risky hack 
I must have been blind while reading your initial post


Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 102
- Joined: Fri Nov 08, 2019 3:23 pm
Re: command line action doesn't always work.
Maybe do a check for the process (AUT exe) and if running kill it?
-
- Posts: 102
- Joined: Fri Nov 08, 2019 3:23 pm
Re: command line action doesn't always work.
I am running both Ranorex and cmd as Administrator. I also try removing attributes in case that helps (it hasn't).
I added a second line, it worked last time. I am running a new build now. It's hokey, but if it works...
I added a second line, it worked last time. I am running a new build now. It's hokey, but if it works...
- Attachments
-
- uninstallCommand.png (40.63 KiB) Viewed 247 times
-
- Posts: 102
- Joined: Fri Nov 08, 2019 3:23 pm
Re: command line action doesn't always work.
And now for whatever reason, it works the first time.
I will keep looking into it, but as long as it does the thing, I am ok.

I will keep looking into it, but as long as it does the thing, I am ok.