Run Application: Use of Windows 10 Local Profiles

Best practices, code snippets for common functionality, examples, and guidelines.
MUP
Posts: 21
Joined: Sat Aug 21, 2021 2:34 pm

Run Application: Use of Windows 10 Local Profiles

Post by MUP » Wed Jan 26, 2022 10:38 am

A smartfolder> testcase>recording>run application has to be used for separate admin-users rxtest1 and rxtest2 on the same machine.

Just run a simple recording action "run application --- powershell --- move-item %userprofile%\desktop\*.txt c:\test -force"
Working directory is set to c:\test
But %userprofile% will not be accepted.
Now using c:\users\rxtest1 instead of %userprofil% then the move-item works successfully.

Is there any solution to get the use of %userprofile% working?
Many thanks


RX 10.1.5
W10 Pro 64bit 21H1

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Run Application: Use of Windows 10 Local Profiles

Post by odklizec » Wed Jan 26, 2022 11:15 am

Hi,

You will have to change the DOS macro to powershell commands. Check this page how to do this:
https://renenyffenegger.ch/notes/Window ... name/index
Pavel Kudrys
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

MUP
Posts: 21
Joined: Sat Aug 21, 2021 2:34 pm

Re: Run Application: Use of Windows 10 Local Profiles

Post by MUP » Wed Jan 26, 2022 11:42 am

Hi @odklizec

That works absolutely perfect.
Thanks for the hint.

When I read this I could remember again.
So I thought the last Omicron attack has eaten up a part of my brain.

Stay healthy and best regards.

MUP

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Run Application: Use of Windows 10 Local Profiles

Post by odklizec » Wed Jan 26, 2022 11:52 am

You are welcome. Good to hear it helped ;)
Pavel Kudrys
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