Home > other >  Bat script command - parameters within double quotes question how to deal with
Bat script command - parameters within double quotes question how to deal with

Time:09-27

 @ echo off 
Set "arg=- unsafely - treat - insecure - origin - as - secure=" http://example.com ", "
The set/p "SRCLNK=please drag need to modify the shortcut to the window and press enter:"
The set SRCLNK=% SRCLNK: "=%
If exist SRCLNK "% %" mshta VBScript: Execute (" Set a=CreateObject (" "WScript. Shell" ") : the Set b=a.C reateShortcut SRCLNK (" "% %" ") : b.A rguments=(arg "" % %" ") : b.S ave: close ")
Echo configuration is successful, please close the window

Role is code, add parameters after into window browser
Parameter is - unsafely - treat - insecure - origin - as - secure="http://example.com"

But there is a double quotation marks in the parameters, can lead to a syntax error,,, is the solution to search on the net,,,, ask how to do

CodePudding user response:

Try this:

 
@ echo off
Set "" arg=- unsafely - treat - insecure - origin - as - secure=" "" "" "
http://example.comThe set/p "" SRCLNK=please drag need to modify the shortcut to the window and press enter:" "
The set SRCLNK=% SRCLNK: "=" %
If exist "" "" mshta VBScript SRCLNK % % : Execute (" "Set a=CreateObject (" "" "WScript. Shell" "" ") : the Set b=a.C reateShortcut (" "" "" "" "SRCLNK % %) : b.A rguments=(" "" "" "" "arg % %) : b.S ave: close" ")
Echo configuration is successful, please close the window

CodePudding user response:

reference 1st floor paullbm response:
so try:

 
@ echo off
Set "" arg=- unsafely - treat - insecure - origin - as - secure=" "" "" "
http://example.comThe set/p "" SRCLNK=please drag need to modify the shortcut to the window and press enter:" "
The set SRCLNK=% SRCLNK: "=" %
If exist "" "" mshta VBScript SRCLNK % % : Execute (" "Set a=CreateObject (" "" "WScript. Shell" "" ") : the Set b=a.C reateShortcut (" "" "" "" "SRCLNK % %) : b.A rguments=(" "" "" "" "arg % %) : b.S ave: close" ")
Echo configuration is successful, please close the window


This is not,,,,,,,

CodePudding user response:

 @ echo off 
Set "arg=- unsafely - treat - insecure - origin - as - secure=" "" "" "" "http://example.com "
The set/p "SRCLNK=please drag need to modify the shortcut to the window and press enter:"
The set SRCLNK=% SRCLNK: "=%
If exist SRCLNK "% %" mshta VBScript: Execute (" Set a=CreateObject (" "WScript. Shell" ") : the Set b=a.C reateShortcut SRCLNK (" "% %" ") : b.A rguments=(arg "" % %" ") : b.S ave: close ")
Echo configuration is successful, please close the window
  • Related