Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Chat with Me -- HOST
#31
(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!  Big Grin

[Image: Start-Notepad2022-12-13-221040.jpg]
Reply
#32
(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!  Big Grin

[Image: Start-Notepad2022-12-13-221040.jpg]



What OS are you running?

I'm running Windows 10, 64-bit.

Pete
Reply
#33
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.
Reply
#34
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
Reply
#35
Thumbs Up 
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.

Reply
#36
Thumbs Up 
(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.
Reply
#37
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

[Image: mnrvovrfc-shellhide.png]
Reply
#38
SHELL _DONTWAIT or SHELL _HIDE _DONTWAIT
not
_SHELLDONTWAIT
Tread on those who tread on you

Reply
#39
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
Reply
#40
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?

[Image: CHR34-14-12-2022.jpg]
Reply




Users browsing this thread: 3 Guest(s)