If I run the following with a service name "purebasicexample" then all is ok.
RunProgram("C:\Windows\System32\sc.exe" , "stop purebasicexample", "C:\Windows\System32\" , #PB_Program_Hide)
Everything worked because purebasicexample is one word
If I try with a split service name for example: pure basic example
RunProgram("C:\Windows\System32\sc.exe" , "stop pure basic example", "C:\Windows\System32\" , #PB_Program_Hide)
No error is shown but it does not work
How do I enter a service name with spaces?
In basic this would be: sc.exe stop "pure basic example"
Thanks
running SC.exe with parameters
Re: running SC.exe with parameters
->
Code: Select all
Debug #DQUOTE$ + "pure basic example" + #DQUOTE$
Re: running SC.exe with parameters
Or literal strings
Literal strings are declared using the " character. Escape sequences are supported using the ~ character before the literal string
http://www.purebasic.com/documentation/ ... rules.html
Literal strings are declared using the " character. Escape sequences are supported using the ~ character before the literal string
Code: Select all
Debug ~"\"pure basic example\""
Last edited by Marc56us on Mon Mar 12, 2018 10:42 am, edited 1 time in total.
- RSBasic
- Moderator
- Posts: 1218
- Joined: Thu Dec 31, 2009 11:05 pm
- Location: Gernsbach (Germany)
- Contact:
Re: running SC.exe with parameters
Or:
\\Edit:
Shit, I was too slow.
Code: Select all
Debug ~"\"pure basic example\""
Shit, I was too slow.
Re: running SC.exe with parameters
or
Code: Select all
chr(34) + "x y z" + chr(34)
Re: running SC.exe with parameters
Many thanks to you all - my problem is solvedMijikai wrote:orCode: Select all
chr(34) + "x y z" + chr(34)