Posts: 1,002
Threads: 50
Joined: May 2022
Reputation:
27
(12-13-2022, 07:00 PM)Pete Wrote: The one you posted with START does work for me...
Example:
Code: (Select All) SHELL _HIDE _DONTWAIT "notepad" ' Doesn't launch.
BEEP: SLEEP
SHELL _HIDE _DONTWAIT "start notepad" ' Launches because of START.
BEEP: SLEEP
_HIDE causes the first one not to launch, but adding "start" in the second example allows it to launch Notepad.
I'd like to buy the explanation that _HIDE prevents the cmd.exe console form launching an app, but I don't believe that is so, because...
For me it is exactly the opposite!
Posts: 2,171
Threads: 222
Joined: Apr 2022
Reputation:
103
(12-13-2022, 09:23 PM)Kernelpanic Wrote: (12-13-2022, 07:00 PM)Pete Wrote: The one you posted with START does work for me...
Example:
Code: (Select All) SHELL _HIDE _DONTWAIT "notepad" ' Doesn't launch.
BEEP: SLEEP
SHELL _HIDE _DONTWAIT "start notepad" ' Launches because of START.
BEEP: SLEEP
_HIDE causes the first one not to launch, but adding "start" in the second example allows it to launch Notepad.
I'd like to buy the explanation that _HIDE prevents the cmd.exe console form launching an app, but I don't believe that is so, because...
For me it is exactly the opposite!
What OS are you running?
I'm running Windows 10, 64-bit.
Pete
Posts: 1,002
Threads: 50
Joined: May 2022
Reputation:
27
12-13-2022, 09:34 PM
(This post was last modified: 12-13-2022, 09:34 PM by Kernelpanic.)
Quote:Pete - What OS are you running?
I'm running Windows 10, 64-bit.
I also. Latest update. -- This is how Notepad starts for me:
Code: (Select All) Shell _Hide _DontWait "D:\Programme\notepad++" ' Doesn't launch.
Beep: Sleep
'Shell _Hide _DontWait "start D:\Programme\notepad++" ' Launches because of START.
Beep: Sleep
Programming is a nice hobby.
Posts: 2,171
Threads: 222
Joined: Apr 2022
Reputation:
103
Interesting. Same OS and you can only get one of those two SHELL calls to work, while I can start my Notepad++ either way...
Code: (Select All) Shell _Hide _DontWait "start C:\Windows\notepad++"
and
Code: (Select All) Shell _Hide _DontWait "C:\Windows\notepad++"
Both work for me.
Now interesting that on my system, Notepad (not ++, just notepad) and Firefox can both be called without a drive and path, but Notepad++ requires the drive and path. The file finding ability is a nice feature of SHELL but again, it is not always reliable. It may have something to do with how the various apps are registered in the registry.
Anyway, the difficulty isn't so much getting whatever you need to work on your device, it's getting them to work, as intended on all devices.
Pete
Posts: 1,002
Threads: 50
Joined: May 2022
Reputation:
27
12-13-2022, 11:10 PM
Quote:Anyway, the difficulty isn't so much getting whatever you need to work on your device, it's getting them to work, as intended on all devices.
That is the way it is! In principle it is like that in almost everything.
Posts: 1,586
Threads: 59
Joined: Jul 2022
Reputation:
52
12-14-2022, 08:35 AM
(12-13-2022, 10:06 PM)Pete Wrote: Interesting. Same OS and you can only get one of those two SHELL calls to work, while I can start my Notepad++ either way...
Code: (Select All) Shell _Hide _DontWait "start C:\Windows\notepad++"
and
Code: (Select All) Shell _Hide _DontWait "C:\Windows\notepad++"
Both work for me.
You're the first person I see online that copies a "foreign" program into "Windows" directory! Instead of creating a directory right under the user's home directory like I have done. Could have had something like:
Code: (Select All) Shell _Hide _DontWait "C:\Users\wabbit\myprogs\notepad++.exe"
Yet it works; the point is to avoid spaces in directory and file names wherever possible. Also Pete, you're only doing what is expected normal on Linux: the application executable is usually installed into "/usr/bin" so that directory has thousands of files and it becomes a mother to check them out with a file manager.
Posts: 1,586
Threads: 59
Joined: Jul 2022
Reputation:
52
12-14-2022, 09:52 AM
(This post was last modified: 12-14-2022, 10:13 AM by mnrvovrfc.)
I made the test for "_SHELLHIDE" function, and discovered now there is no such thing as "_SHELLDONTWAIT". Notice the failed attempt to compile with "_SHELLDONTWAIT".
Notice that even with "_SHELLHIDE" a dummy console window is shown. But this might be on my 10-year-old laptop and it would help if I had the latest QB64PE. (It's proof that I am doing almost nothing on Windows since the beginning of summer, too busy Linux distro-hopping LOL.) In order to get the user program to display the return value of "x", I closed NPPP, then opened it again to show the source code.
https://qb64phoenix.com/forum/showthread...1#pid11541
Posts: 733
Threads: 30
Joined: Apr 2022
Reputation:
43
12-14-2022, 04:42 PM
(This post was last modified: 12-14-2022, 04:42 PM by SpriggsySpriggs.)
SHELL _DONTWAIT or SHELL _HIDE _DONTWAIT
not
_SHELLDONTWAIT
Tread on those who tread on you
Posts: 2,171
Threads: 222
Joined: Apr 2022
Reputation:
103
But... We used to have a keyword combo to stop Bill: _SHELDON _WAIT
Oh, and don't forget... I hatz wabbits! (Fudd Sam hybrid?)
Pete
Posts: 1,002
Threads: 50
Joined: May 2022
Reputation:
27
Code: (Select All) Print Chr$(34)
Print
'If _FileExists("D:\Program Files\Notepad++\notepad++.exe") Then
'Shell "D:\" + Chr$(34) + "Program Files" + Chr$(34) + "\Notepad++\notepad++.exe tmp.three"
'Else
'Print "Cannot find notepad++"
'End If
If _FileExists("D:\Program Files\Notepad++\notepad++.exe") Then
Shell "D:\" + " + "Program Files" + " + "\Notepad++\notepad++.exe tmp.three"
Else
Print "Cannot find notepad++"
End If
The CHR$(34) function stands for the Ascii character >"<. If I now replace CHR$(34) with the relevant character, the error message below appears - see screenshot.
Is it correct that CHR$(34) is only intended to prevent >"< from being criticized as already existing?
|