logo
down
shadow

"Invalid Request" error when checking launched programs


"Invalid Request" error when checking launched programs

By : user2953034
Date : November 19 2020, 03:59 PM
this one helps. I wanted to write a program that checks every 15 minutes if amount of programs is launched like (toto1.bat, toto2.bat,toto3.bat, iexplore.exe …) whether it finds nothing so it launch it. , I solved the problem like this :
code :
Option Explicit
If AppPrevInstance() Then   
    MsgBox "Il y a une instance déjà en cours",VbExclamation,"Il y a une instance déjà en cours"    
    WScript.Quit   
Else   
    Do   
        Call Main(Array("c:\toto1.bat","c:\toto2.bat","c:\toto3.bat","%ProgramFiles%\Internet Explorer\iexplore.exe"))
        Call Pause(15) 'Pause de 15 minutes
    Loop   
End If   
'**************************************************************************
Sub Main(colProcessPaths)   
    Dim ProcessPath   
    For Each ProcessPath In colProcessPaths     
        CheckProcess(ProcessPath)   
    Next   
End Sub   
'**************************************************************************
Sub CheckProcess(ProcessPath)   
    Dim ProcessName : ProcessName = StripProcPath(ProcessPath)   
    With GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")   
        With .ExecQuery("SELECT * FROM Win32_Process WHERE Commandline LIKE " &  CommandLineLike(ProcessName))      
            If .Count = 0 Then    
                With CreateObject("WScript.Shell")  
                    .Run DblQuote(ProcessPath) 
                End With    
            Else    
                Exit Sub    
            End if   
        End With   
    End With   
End Sub   
'**************************************************************************
Function AppPrevInstance()   
    With GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")   
        With .ExecQuery("SELECT * FROM Win32_Process WHERE CommandLine LIKE " & CommandLineLike(WScript.ScriptFullName) & _
        " AND CommandLine LIKE '%WScript%' OR CommandLine LIKE '%cscript%'")   
            AppPrevInstance = (.Count > 1)   
        End With   
    End With   
End Function   
'**************************************************************************
Sub Pause(Minutes)    
    Wscript.Sleep(Minutes*1000*60)    
End Sub   
'**************************************************************************
Function StripProcPath(ProcessPath)   
    Dim arrStr : arrStr = Split(ProcessPath, "\")   
    StripProcPath = arrStr(UBound(arrStr))   
End Function   
'**************************************************************************
Function CommandLineLike(ProcessPath)   
    ProcessPath = Replace(ProcessPath, "\", "\\")   
    CommandLineLike = "'%" & ProcessPath & "%'"   
End Function
'**************************************************************************
'Fonction pour ajouter les doubles quotes dans une variable
Function DblQuote(Str)
    DblQuote = Chr(34) & Str & Chr(34)
End Function
'**************************************************************************


Share : facebook icon twitter icon
PayPal Adaptive Payments - Preapproval request results in "Invalid request" error

PayPal Adaptive Payments - Preapproval request results in "Invalid request" error


By : Erik Johansson
Date : March 29 2020, 07:55 AM
will help you I can't figure out what's happening with my Preapproval HTTP POST request. I'm just trying to do a basic call to PayPal's Adaptive Payments API, the Preapproval call specifically. And the PayPal error 580001 "Invalid request" is not that helpful in itself. , OK fixed. How?
Fix #1
code :
"requestEnvelope": {
    "errorLanguage": "en_US"
}, 
"clientDetails": {
    "applicationId": "APP-XXXXXXXXXXXXX"
}, 
"Invalid arithmetic operator" error when checking hostname in Bash script

"Invalid arithmetic operator" error when checking hostname in Bash script


By : Piseth Sokchamreun
Date : March 29 2020, 07:55 AM
With these it helps Because -eq is not for string comparisons, but an arithmetic operator, as described in the bash documentation.
You can swap -eq with = or ==, and you are fine.
I get "Invalid utf 8 error" when checking string, but it seems correct when i use std::cout

I get "Invalid utf 8 error" when checking string, but it seems correct when i use std::cout


By : el correky
Date : March 29 2020, 07:55 AM
wish of those help The shell to which you write output is probably rather robust against characters it doesn't understand. It seems, not all of the used software is. It should, however, be relatively straight forward to verify if you byte sequence is a valid UTF-8 sequence: the UTF-8 encoding is relatively straight forward:
each code point starts with a byte representing the number of bytes to be read and the first couple of bytes: if the high bit is 0, the code point consists of one byte represented by the 7 lower bits otherwise the number of leading 1 bits represent the total number of bytes followed by a zero bit (obiously) and the remaining bits become the high bits of the code point since 1 byte is already represented, bytes with the high bit set and the next bit not set are continuation bytes: the lower 6 bits are part of the representation of the code point
docker: Error creating container: 400 Client Error: Bad Request (\"invalid reference format\")"

docker: Error creating container: 400 Client Error: Bad Request (\"invalid reference format\")"


By : h_droid
Date : March 29 2020, 07:55 AM
I hope this helps you . Docker image names can only consist of lowercase (a-z) characters. Either you are giving a un-supported image name or the variable(or paths) passed to the buid(or the container) cannot be resolved.
To enable debug logs, add "--debug" to docker daemon (/etc/systemd/system/multi-user.target.wants/docker.service for systemd based linux env)
Cloudflare API issue put request ("code":9020,"message":"Invalid DNS record type")

Cloudflare API issue put request ("code":9020,"message":"Invalid DNS record type")


By : user2358415
Date : March 29 2020, 07:55 AM
it should still fix some issue I am having issue while using cloudflare APIv4. Trying to update a dns record and not sure why am I receiving following error:             , You're sending a payload of:
code :
$POST = json_encode(array(
    "type" => "A",
    "name" => "...",
    ...
));
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org