How to Run system paths like %userprofile%\AppData\Local\Temp Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Haswell
Posts: 90
Joined: 21 Feb 2016, 17:11

How to Run system paths like %userprofile%\AppData\Local\Temp

22 Feb 2017, 02:59

How to Run system path like:

Code: Select all

Run, %userprofile%\AppData\Local\Temp
It treats like a variable but I need to use standard windows path %userprofile% instead.
I know about AHK variables A_... but I would like to know does AHK support Windows system paths.
Focusing our efforts on non-productive and non-creative endeavours wastes lives as surely as war.
Jacque Fresco / The best that money can't buy
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: How to Run system paths like %userprofile%\AppData\Local\Temp  Topic is solved

22 Feb 2017, 03:49

Do you mean to escape the %'s?

I get an error when I try to use ^2::Run, `%userprofile`%\AppData\Local\Temp though. I know you said you know about the built-in variables, but since that one gives me an error, if I wanted to launch into the Temp folder I would use ^2::Run, C:\Users\%A_UserName%\AppData\Local\Temp.

Here's some shotty workaround code. The ^4 hotkey works.

Code: Select all

^2::Run, C:\Users\`%userprofile`%\AppData\Local\Temp
^4::
Run, explorer.exe,,,pid
; winwait doesn't really work with the pid to distinguish which window to target
; so I just wait 250 ms and hope it launches in time, becoming the most recent window
Sleep 250
Send ^l
Sleep 100
Send `%userprofile`%{Enter}
return

; the below didn't work in place of the normal Send. I used to be able to manipulate
; the toolbars like this, but only in SaveAs dialogs, not necessarily Explorer.exe
^6::
*/
ControlSend, ToolbarWindow323, ahk_exe explorer.exe
Sleep 250
ControlSend, ahk_parent, ^l, ahk_exe explorer.exe
Sleep 250
ControlSend, Edit1, `%userprofile`%{Enter}, ahk_exe explorer.exe
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada and 317 guests