Script to open a folder

Get help with using AutoHotkey and its commands and hotkeys
Evil-e
Posts: 146
Joined: 04 Sep 2018, 11:09

Script to open a folder

18 Mar 2020, 17:59

I have the following that works in a batch file:

%SystemRoot%\explorer.exe "folder address"

but unsuccessful in getting it to work with an AHK script.....

Searched "script to open folder" and variations of it, but no luck. Does anyone know hot to make it work?

:morebeard:
I have a bit of experience opening and sending commands to game console and CMD.exe... just ask :)
User avatar
Yakshongas
Posts: 482
Joined: 21 Jan 2020, 08:41
Facebook: Yakshongas

Re: Script to open a folder

18 Mar 2020, 18:24

This works for me.

Code: Select all

F1::
Run, %SystemRoot%\explorer.exe "C:\windows\system32\"
return
Please mark your topics as solved if you don't need any further help. ✅
User avatar
flyingDman
Posts: 757
Joined: 29 Sep 2013, 19:01

Re: Script to open a folder

18 Mar 2020, 20:44

Code: Select all

run, C:\windows\system32
Evil-e
Posts: 146
Joined: 04 Sep 2018, 11:09

Re: Script to open a folder

18 Mar 2020, 21:47

EDIT: SPOKE A BIT TOO SOON, AS I AM UNABLE TO OPEN A DIRECTORY WITH AN "&" SYMBOL

I thank you both, but @flyingDman was the solution that worked for me, after I tweaked the code a bit further :)

The following works fine:

Code: Select all

    Run, "C:\WINDOWS\system32\Commandmeister.exe"            ;Commandmeister.exe = custom mod to open CMD.exe
    sleep, 10
    Run, D:\Games\Alarm für Cobra 11\Nitro
    sleep, 250
    Run, G:\Games\+ INSTALLATION DIRECTORY SAVES\Alarm für Cobra 11\Nitro
    sleep, 100
    Process, Close, Commandmeister.exe
But, this does not:

Code: Select all

    Run, "C:\WINDOWS\system32\Commandmeister.exe"
    sleep, 10
    send cd /d "G:\Games\Guns, Gore & Cannoli\Profile\Evil-e"{enter}      ;no problem accessing folder and deleting empty directories
    sleep, 10
    send rmdir /q /s UGC{enter}
    sleep, 10
    send rmdir /q /s Local{enter}
    sleep, 10
    send rmdir /q /s Saves{enter}
    sleep, 10
    send rmdir /q /s Screenshots{enter}
    sleep, 10
    send rmdir /q /s SavesBackup{enter}
    sleep, 10
    send del SteamUserID.cfg{enter}
        sleep, 10
    Run, G:\Games\Guns, Gore & Cannoli                                    ;but hangs up here
    sleep, 10
    Process, Close, Commandmeister.exe
I have tried a whole bunch of variations of "cd" and with / without quotes, but the "&" symbol hangs up the open folder command....

.... any thoughts?

:morebeard:
I have a bit of experience opening and sending commands to game console and CMD.exe... just ask :)

Return to “Ask For Help”

Who is online

Users browsing this forum: dentopolis, Xtra and 58 guests