Get error when run wt with params Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
dxcqcv
Posts: 1
Joined: 04 Jun 2021, 17:35

Get error when run wt with params

Post by dxcqcv » 04 Jun 2021, 17:56

I wanna auto run mondodb when win startup, like following step

1. open wt or powershell
2. cd F:\diskF\username\scoop\apps\mongodb\4.4.4\bin
3. .\mongod.exe -f F:\diskF\Roy\db\mongo\config\mongod.cfg

and my ahk is

Code: Select all

#SingleInstance force ;
^k::
Run, wt ""new-tab " " cd F:\diskF\username\scoop\apps\mongodb\4.4.4\bin" ".\mongod.exe -f F:\diskF\Roy\db\mongo\config\mongod.cfg" " 
return
then get error

Code: Select all

[when start “" " cd "F:\diskF\username\scoop\apps\mongodb\4.4.4\bin .\mongod.exe" -f "F:\diskF\Roy\db\mongo\config\mongod.cfg "” get error 0x80070057]
how do I fix it, help

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

Re: Get error when run wt with params  Topic is solved

Post by swagfag » 04 Jun 2021, 20:48

try

Code: Select all

^k::Run wt new-tab powershell -NoExit -Command "Set-Location 'F:\diskF\username\scoop\apps\mongodb\4.4.4\bin'\; .\mongod.exe -f F:\diskF\Roy\db\mongo\config\mongod.cfg" 
;                                                                                                            ^^ - escaped powershell command separator needed,
;                                                                                                                 because wt also uses ';' as a separator

pmobin
Posts: 17
Joined: 14 Apr 2016, 12:50

Re: Get error when run wt with params

Post by pmobin » 01 Dec 2021, 10:20

Has anyone here figures out how to use mongodb with autohotkey routines? Please point to any sources.

Post Reply

Return to “Ask for Help (v1)”