Author Topic: Aliases Launched Exe's Get Current Tab As Startup Folder Not Origin Root Folder  (Read 105 times)

total_annihilation00

  • Active Member
  • ***
  • Posts: 92
  • Tech Savant\ Envisioneering
    • View Profile
Issue Description:
When launching applications via Aliases, the active tab's path (representing the current working directory) is being assigned as the configuration or log file storage location instead of the application's actual startup directory. Specifically, the application’s startup folder, as defined in the executable’s properties (the "Startup Folder" in the Exe Properties), is not being used as the working directory upon launch.

Details:
  • For example, launching Yahoo-8Ball-Pool-Clone.exe via an alias ("8ball") like:
Code: [Select]
!"D:\Download\cpp-projekt\FuzenOp_SiloTest\Release\Yahoo-8Ball-Pool-Clone.exe"
results in the current tab being D:\Download\AutoHotkey\Compiler\, and the application writes its config/log files into this directory instead of its intended startup directory (in my case the "Pool-Settings.txt" config file was placed in here erroneously).
  • The root cause appears to be that the application’s working directory is incorrectly set to the active tab (the current working directory in the shell or environment), rather than the "Startup Folder" as specified in the executable properties.
  • This causes files that are supposed to be stored in the application's startup directory to instead be stored in the current tab's directory, leading to misplaced configuration files and logs.

Summary:
The launch mechanism via Aliases incorrectly assigns the current working directory (the open tab) as the application's working directory, instead of using the executable's designated startup folder. This behavior constitutes a bug in how the environment initializes the app's working context upon launch.
« Last Edit: Today at 08:51:14 by total_annihilation00 »
~The World's Deceit Has Raped My Soul, We Melt The Plastic People Down Then We Melt Their Plastic Town~


Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4668
    • View Profile
    • Multi Commander
Not a bug, but a feature. :)

Example. I assign alias "n" to "Notepad2.exe" then I can do "n newfile.txt" and I get the new file in the current folder.

Not sure if both situation can work.. Maybe create a shortcut for the .exe that needs its working dir and execute that via alias

total_annihilation00

  • Active Member
  • ***
  • Posts: 92
  • Tech Savant\ Envisioneering
    • View Profile
Oh I see, well I feared it would come to that —I'll link to a shortcut then.  ;D

P.S: Wait, will making a User Defined Command to hotlink the file work ? Nvm, I'll stick to using a shortlink .LNK. User Defined Commands > Custom Commands > Run; seems to do the trick !
« Last Edit: Today at 09:03:38 by total_annihilation00 »
~The World's Deceit Has Raped My Soul, We Melt The Plastic People Down Then We Melt Their Plastic Town~


Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4668
    • View Profile
    • Multi Commander
Oh I see, well I feared it would come to that —I'll link to a shortcut then.  ;D

P.S: Wait, will making a User Defined Command to hotlink the file work ? Nvm, I'll stick to using a shortlink .LNK.

You can also create a UserDefinedCommand that start it, and then call the UDC from alias using ID of the script. .Just out a @ in front of the id
Like  @6d35f84f73a74dfbb16ca370ccb625f7

Maybe can add so a special character first of the command tells it to use the command paths as working folder.. like maybe "$" instead of "!", I check if that possible
« Last Edit: Today at 09:06:46 by Mathias (Author) »

total_annihilation00

  • Active Member
  • ***
  • Posts: 92
  • Tech Savant\ Envisioneering
    • View Profile
Yeah, I'am way ahead of ya… 😂
« Last Edit: Today at 10:32:54 by total_annihilation00 »
~The World's Deceit Has Raped My Soul, We Melt The Plastic People Down Then We Melt Their Plastic Town~


total_annihilation00

  • Active Member
  • ***
  • Posts: 92
  • Tech Savant\ Envisioneering
    • View Profile
Maybe can add so a special character first of the command tells it to use the command paths as working folder.. like maybe "$" instead of "!", I check if that possible

Wow that's a brilliant idea, you should definitely do that —would save a lot of hassle (of porting them to User-Defined Commands) !
« Last Edit: Today at 09:27:14 by total_annihilation00 »
~The World's Deceit Has Raped My Soul, We Melt The Plastic People Down Then We Melt Their Plastic Town~