Username problem when transferring script to another pc

I’ve hardcoded file paths in the script.
I want to run the file on another pc.

  1. PC 1 username - admin
  2. PC 2 username - user

How to change the file path once and make it variable?

Like in ahk we have “A_Username” for it.

Thanks!

@Munish_Jain

Instead of hardcoded

It’s better to make always changing variables to use assets if you are using Orchestrator

If not you can use Config file

Hope this helps you

Thanks

Yeah that’s why I’m asking how to change the file paths to incorporate variable username :stuck_out_tongue:

@Munish_Jain

You can define a IF condition as system.Environment.UserName to get the username of the logged in System, accordingly you can give the logic to give the username

Hope this helps you

Thanks

Will try it out thanks

@Munish_Jain

OK, Let me know if any issue

Mark as solution if this helps

Follow Link

Thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.