Opening URL works in Run box but not in batch script - windows

When I open a URL through the Run box it executes successfully, but not when put in a batch script.
When I try to run this URL in a batch script
com.epicgames.launcher://apps/fn%3A4fe75bbc5a674f4f9b356b5c90567da5%3AFortnite?action=launch&silent=true
it returns this error
com.epicgames.launcher://apps/fn%3A4fe75bbc5a674f4f9b356b5c90567da5%3AFortnite?action=launch&silent=true
'com.epicgames.launcher:' is not recognized as an internal or external command,
operable program or batch file.
'silent' is not recognized as an internal or external command,
operable program or batch file.
but when I run it in the Run box, it works normally.

A batch file can only execute .exe, .com and other batch files.
Use the start command to launch other things:
#echo off
start http://example.com/?foo^&bar
And as noted in the comments, you need to deal with special characters. % must be changed to %% and & to ^& etc...

Related

'C:\Program' is not recognized as an internal or external command, operable program or batch file' error in Windows

I am getting this error "'C:\Program' is not recognized as an internal or external command,
operable program or batch file" for most of the commands that I run in PowerShell or command prompt. It appears when I run any code , no matter what language it is. In flutter, it appears 3 times and once in c or cpp. Though, it does not interrupt the program but I'm wondering what is causing this issue. Whenever I start command prompt. This error appears first and then command prompt works normally however it does not appear on starting PowerShell or Git bash. Any fix for this?

Batch not launching exe when in Administrator mode

I've got a simple exe application that writes in a file the first argument with which it gets called, so from command line I can do
MySimpleApp.exe "FOO"
and in the SimpleFile.cfg I get "FOO".
If I try to run this batch (it's in the same folder of the app)
set mypath=%~dp0
%mypath%MySimpleApp.exe "FOO1"
%mypath%MySimpleApp.exe "FOO2"
%mypath%MySimpleApp.exe "FOO3"
every time MySimpleApp gets called Windows ask the administrator permissions to execute the app. I thought that I could just run the batch as administrator, but even if I get no UAC prompt the application doesn't execute.
Is there some option or command that I must use to call an exe file when the batch is launched in administrator mode?
Filenames with spaces MUST be enclosed in quotes.
Always tack a pause at the end of a batch to see how it is interpreting your commands. And likewise if using Echo Off turn it on. Hiding information from yourself about YOUR error is not wise.
So
C:\Users\FirstName LastName\Desktop>C:\Users\FirstName LastName\Desktop\MySimpleApp.exe "FOO3"
'C:\Users\FirstName' is not recognized as an internal or external command,
operable program or batch file.

'startServer.bat' is not recognized as an internal or external command,

I am facing a strange problem. I have a batch file in windows 7 and when i run the file just by double clicking, it runs but with limited access error because it resides inside program files.
When i right click the file and give "run as administrator, the batch file throws below error.
'startServer.bat' is not recognized as an internal or external command,
operable program or batch file.
'wsadmin.bat' is not recognized as an internal or external command,
operable program or batch file.
'stopServer.bat' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . . . `
Below is my batch file , Please check and throw some light on it.
#echo off
call startServer.bat server1
call wsadmin.bat -f configldap.py
call stopServer.bat server1
pause`
Since this comment appeared to be sufficient as an answer:
The administrator account probably has a different PATH environmental variable to your normal user, try making your batch file call /path/to/startServer.bat etc

Command prompt issue C:\Users is not recognized as an internal or external command, operable program or batch file

My command prompt is having some issues. C:\Users is not recognized as an internal or external command, operable program or batch file. I don't know what the issue is. It was working 5 min previously when I was working in java not it will not recognize anything. The only thing that I did previous to that was to delete off my mysql data directly from the folder.
Are you trying to open the directory? in this case it would be
cd C:\Users

Where does windows cls.exe reside?

As we know windows CMD can clear the scren by cls.exe command. But I cannot find the command location.
Usually, I can use which to find the location of the command program file.
But for cls.exe, it does not work, and displays as:
which: no cls in c:\Windows\System32...
Could you guys help me how cmd works? I searched on the internet, only finding clues on how to use it. Not how itself works!
There is no cls.exe. 'cls' is an CMD.EXE internal built-in.
It's built-in command to cmd.exe and not a stand-alone program.
i.e. cls.exe does not exist:
C:\>"cls.exe"
'"cls.exe"' is not recognized as an internal or external command,
operable program or batch file.
C:\>"cls.com"
'"cls.com"' is not recognized as an internal or external command,
operable program or batch file.
C:\>"find.exe"
FIND: Parameter format not correct
The last one, find.exe, is just there to show what happens when it exists.

Resources