You are here: PSPad forum > English discussion forum > Re: Using command line options while pspad.exe is already running

Re: Using command line options while pspad.exe is already running

#1 Using command line options while pspad.exe is already running

Posted by: extrn | Date: 2022-03-04 19:51 | IP: IP Logged

When I try to execute a command

> pspad -F text_to_search filename.txt

to open another file while pspad process is already running, the command line options are interpreted as file names.
So pspad tries to open files "-F", "text_to_search" and "filename.txt"

if the process is not running, the command line options work as expected.

Options: Reply | Quote | Up ^


#2 Re: Using command line options while pspad.exe is already running

Posted by: pspad | Date: 2022-03-04 20:01 | IP: IP Logged

Pspad version?
Try to use pspad.exe instead of pspad in command line

Options: Reply | Quote | Up ^


#3 Re: Using command line options while pspad.exe is already running

Posted by: extrn | Date: 2022-03-04 20:32 | IP: IP Logged

Latest version 5.0.6 (x64)
Windows 7 (x64)

I also tried

> PSPad.exe -F text_to_search filename.txt

and

> "C:\Program Files\PSPad editor\PSPad.exe" -F text_to_search filename.txt

with the same result

when I created the windows shortcut file with command line

"C:\Program Files\PSPad editor\PSPad.exe" -F text_to_search filename.txt

the result was even more unexpected: pspad tried to open "Program", "PSPad", "-F", "text_to_search" and "filename.txt"

Options: Reply | Quote | Up ^


#4 Re: Using command line options while pspad.exe is already running

Posted by: extrn | Date: 2022-03-04 20:47 | IP: IP Logged

"C:\Program", "Files\PSPad", "editor\-F", "text_to_search" and "flename.txt"

to be exact

Options: Reply | Quote | Up ^


#5 Re: Using command line options while pspad.exe is already running

Posted by: pspad | Date: 2022-03-05 05:42 | IP: IP Logged

Try please 5.0.7 from developer forum. I will check it too

Options: Reply | Quote | Up ^


#6 Re: Using command line options while pspad.exe is already running

Posted by: extrn | Date: 2022-03-05 07:57 | IP: IP Logged

same problem (both x86 and x64) :(

Here is some related issue

Running the program for the first time:

C:\>cd C:\some_folder
C:\some_folder>C:\pspad507\PSPad.exe 1.txt 2.txt

"C:\some_folder\1.txt" and "C:\some_folder\2.txt" are opened as expected
-------------------------------------------------------------------------

Then while process is running:

C:\some_folder>cd C:\another_folder
C:\another_folder>C:\pspad507\PSPad.exe 3.txt 4.txt

"C:\another_folder\3.txt" and "C:\some_folder\4.txt" are opened
-------------------------------------------------------------------------

Now I'm closing all files (pspad is still running). And once again:

C:\another_folder>C:\pspad507\PSPad.exe 3.txt 4.txt

"C:\another_folder\3.txt" and "C:\pspad507\4.txt" are opened
-------------------------------------------------------------------------

Things get even worse when there are spaces in the work path

C:\some_folder>C:\pspad507\PSPad.exe
C:\some_folder>cd "C:\another folder with spaces"
C:\another folder with spaces>C:\pspad507\PSPad.exe 1.txt 2.txt

Opened files:
C:\another
C:\some_folder\folder
C:\some_folder\with
C:\some_folder\spaces\1.txt
C:\some_folder\2.txt
-------------------------------------------------------------------------

Closing files, repeat:
C:\another folder with spaces>C:\pspad507\PSPad.exe 1.txt 2.txt

Opened files:
C:\another
C:\pspad507\folder
C:\pspad507\with
C:\pspad507\spaces\1.txt
C:\pspad507\2.txt

Options: Reply | Quote | Up ^


#7 Re: Using command line options while pspad.exe is already running

Posted by: pspad | Date: 2022-03-17 13:53 | IP: IP Logged

extrn:
When I try to execute a command

> pspad -F text_to_search filename.txt

to open another file while pspad process is already running, the command line options are interpreted as file names.
So pspad tries to open files "-F", "text_to_search" and "filename.txt"

if the process is not running, the command line options work as expected.

I just test it. It works for me even PSpad isn't running or is already running and file is/isn't open

You can prevent all problems with your command line parameters to write at least PSPad.exe, not pspad only and the best is to use whole path to pspad.exe and to your files. If there is long path with spaces, use quotes.

Imagine:
PSpad is running. You call PSPad with some parameters without any paths.
Windows starts new PSpad instance with parameters you sent. PSPad must send parameters into existing instance but their work directory is different.

Try to use your examples and use at least pspad.exe

Options: Reply | Quote | Up ^


#8 Re: Using command line options while pspad.exe is already running

Posted by: halweg | Date: 2022-05-25 08:55 | IP: IP Logged

This thread seems to be near to my problem so I hope it's not a problem to reuse it.

I usually open pspad with
<pspad.exe-path> /FR "<searchstring>" "file-path"

This works fine and I can i.e. open a second pspad window with a library file using a searchstring from the first one.

The problem is that a second call of this command line opens a second window with the library file and a new instance of pspad. So editing the second file is no more possible cause risk of inconsistencies.

I know that I can avoid the problem when allowing only one instance of pspad. But this way it isn't possible to have two separate pspad windows side by side (on different monitors) what is very important for my overview.

Is there an option to find a string inside an open pspad window by command line? Or just to avoid open a second window with the same file?

Options: Reply | Quote | Up ^


#9 Re: Using command line options while pspad.exe is already running

Posted by: pspad | Date: 2022-05-25 10:13 | IP: IP Logged

Patience please. Your problem is in my evidence. First I have to solve some serious problems that do not concern the PSPad. Work on PSpad is slow now.

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR