%userprofile% in V2 problem...

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
4k3or3et
Posts: 35
Joined: 23 Jan 2019, 13:58

%userprofile% in V2 problem...

Post by 4k3or3et » 31 Mar 2023, 04:31

Hi All

i am trying ot user V2 for the first time and I am having problem with %userprofile% system variable. I am trying to run something simple:

run(`%userprofile`%\programs\nircmd.exe elevate wt)

but i am getting:

Error: Illegal character in expression.

Can anyone help me undestand the way to go in this matter with AHKV2?

[Mod edit: Moved topic from 'Scripts and Functions (v2)':]

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: %userprofile% in V2 problem...

Post by swagfag » 31 Mar 2023, 05:10

use GetEnv() function
learn how strings work in v2
read the docs tutorial

User avatar
mikeyww
Posts: 26601
Joined: 09 Sep 2014, 18:38

Re: %userprofile% in V2 problem...

Post by mikeyww » 31 Mar 2023, 07:03


Post Reply

Return to “Ask for Help (v2)”