Skip to content

Start.exe causes sumatrapdf to load settings from profile dir rather than local #4854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Universal-Invariant opened this issue Mar 18, 2025 · 6 comments

Comments

@Universal-Invariant
Copy link

Universal-Invariant commented Mar 18, 2025

latest ver 3.6

e.g.,

start.exe /D "C:\Temp" "C:\Temp\SumatraPDF.exe" "C:\my.pdf"

When quotes are used it fails, without quotes it works. That is, using quotes around the executable causes it to load the wrong settings.

start.exe /D "C:\Temp" C:\Temp\SumatraPDF.exe "C:\my.pdf"

This is fine unless the path has spaces ;/

@GitHubRulesOK
Copy link
Collaborator

HMMM may be red herring

start /? says ["title"] but experience says that ideally should be ""|["title"] as without "" it DOES tend to on occasion behave oddly

I have no problem with any of

start "test" /d "c:\test" "C:\Users\K\source\repos\sumatrapdf\sumatrapdf.exe" "c:\test\out.pdf"

OR

start "test" /d "c:\test" "C:\Users\K\source\repos\sumatrapdf\sumatrapdf.exe" c:\test\out.pdf

OR

start "test" /d c:\test C:\Users\K\source\repos\sumatrapdf\sumatrapdf.exe c:\test\out.pdf

all should be using same settings C:\Users\K\source\repos\sumatrapdf\SumatraPDF-settings.txt

HOWEVER I am using a newly compiled version and it is possible the 3.6 you have access to may have different behaviour let me roll back to current pre-release.

@GitHubRulesOK
Copy link
Collaborator

GitHubRulesOK commented Mar 18, 2025

No that does not make any difference both these are the same settings

start "test" /d "c:\test" C:\Users\K\source\repos\sumatrapdf\SumatraPDF-prerel-32 "c:\test\out.pdf"
start "test" /d "c:\test" "C:\Users\K\source\repos\sumatrapdf\SumatraPDF-prerel-32" "c:\test\out.pdf"

HOWEVER

start /d "c:\test" "C:\Users\K\source\repos\sumatrapdf\SumatraPDF-prerel-32" "c:\test\out.pdf"

DOES use the default profile so as first guessed it is start "" is the difference
thus

start "" /d "c:\test" "C:\Users\K\source\repos\sumatrapdf\SumatraPDF-prerel-32" "c:\test\out.pdf"

Also works as intended

@Universal-Invariant
Copy link
Author

Ok, that is it. I guess the title is required. I find it strange that it parses it enough to run the exe correctly when the title isn't supplied.

@GitHubRulesOK
Copy link
Collaborator

GitHubRulesOK commented Mar 18, 2025

I have seen similar with some other apps the lack of the empty quotes start "" or start "quoted" seem to affect later command line use of quotes and current SumatraPDF admittedly can be a bit fickle in that as it uses DDE commands for total recall which in turn may depend on static quotes in initial external call.

@Universal-Invariant
Copy link
Author

Universal-Invariant commented Mar 19, 2025

Do you happen to know if using DDE to open a file is different than just passing the filename?

What I'm doing, which is working, is opening SumatraPDF by passing the filename directly. I use start because I'm using a script and I need to run it asynchronously and also do not want a command prompt. Using start works(and now it works with the correct settings). Although it seems sometimes it pops up the dialog or stalls for a bit, I think, but it is rare.

I then use DDE further. I'm just wondering if there is any functional difference. E.g., would using DDE automatically create the asynchronous call so that I don't have to use start? I guess I can try and see if it matters or not.

One issue I sort of have is that there seems to be no way to determine if the pdf has been loaded yet. I'm using sleep but if, say, the HD is sleeping then this could cause the initial DDE commands to fail unless they are in a queue. I can only find one mention of queue w.r.t. dde and it vague. If it does then I shouldn't have to worry about it, if so then I guess I'll have to use some process checking to see if it is loaded.

@GitHubRulesOK
Copy link
Collaborator

GitHubRulesOK commented Mar 19, 2025

I am not the developer so only DDE experience is as CLI user.
DDE needs to be run either by a separate resident daemon OR on first run of an Application hence the first call can be the longest.

Adobe acrobat use the /T switch to keep Acrobat Task resident in memory for printing and then everybody wants to TaskKill which is wrong. CJK users found they could work more efficiently by fire up Acrobat with a DDE start and end with a DDE stop. Unlikely they adapted for SumatraPDF as it is faster anyway and uses the inbuilt DDE start on session start and steps down at the end of session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants