Extra quotes in variables

Started by rmpf2

rmpf2

Extra quotes in variables   02 June 2016, 02:25

Hi Andrew,
recently I've been aware of some errors trying to execute some of my defined applications on NS that use variables declarations.

Example:
Application Title: U|User|Unlock|Account|Parameters Not Required
Command Line: cmd /k "%Joeware_VAR\Unlock.exe" . [Logged User]

Variable: Joeware_VAR
Value: \PortableApps\Administrative_Utils\NirLauncher\Joeware Tools

To debug the strange behavior of the unlock tool of joeware I used the echo command to found what NS was replacing for the %Joeware_VAR variable.

Echo results:
cmd /k ""\PortableApps\Administrative_Utils\NirLauncher\Joeware Tools"\Unlock.exe" . [Logged User]

To work results should be:
cmd /k "\PortableApps\Administrative_Utils\NirLauncher\Joeware Tools\Unlock.exe" . [Logged User]
without the extra quotes ("").

Thanks.
SoftPerfect Support forum - Andrew avatar image

Re: Extra quotes in variables   02 June 2016, 08:34

Looks like a a bug. Try the new build, it now doesn't quote variables whose value contains a space if those variables are already used in quotes.
rmpf2

Extra quotes in variables   03 June 2016, 06:36

Thanks. For the case exposed it works but for the following case remain a similar issue.

Application Title: W|WMI|SimpleWMIView - Displays results of WMI simple queries|Synchronous Mode|Namespace|root\CIMV2|Class|WIN32_Process|Report|Scomma Format File|Sort By|CommandLine

Command Line:
cmd /k echo """%NirSoft_VAR\SimpleWMIView.exe" /ConnectComputer 2 /ComputerName {Enter Computer Name:[Host Name]} /SyncMode 2 /Namespace "root\CIMV2" /Class "WIN32_Process" /scomma "%NirSoft_VAR\SimpleWMIView_Reports\%0_[Host Name]_[WMI - ComputerSystem_User Online]_%date:~10,4%-%date:~4,2%-%date:~7,2%_Processes_Report.csv" /Sort "CommandLine"" & "%NirSoft_VAR\CSVFileView.exe" /load "%NirSoft_VAR\SimpleWMIView_Reports\%0_[Host Name]_[WMI - ComputerSystem_User Online]_%date:~10,4%-%date:~4,2%-%date:~7,2%_Processes_Report.csv""

Echo results:
"""\PortableApps\WSCCPortable\App\WSCC\NirSoft Utilities\SimpleWMIView.exe" /ConnectComputer 2 /ComputerName drd-42942 /SyncMode 2 /Namespace "root\CIMV2" /Class "WIN32_Process" /scomma "\PortableApps\WSCCPortable\App\WSCC\NirSoft Utilities\SimpleWMIView_Reports\*.*.*.*_drd-42942_SPORTSNET\bsalgado_2016-06-02_Processes_Report.csv" /Sort "CommandLine"" & ""\PortableApps\WSCCPortable\App\WSCC\NirSoft Utilities"\CSVFileView.exe" /load ""\PortableApps\WSCCPortable\App\WSCC\NirSoft Utilities"\SimpleWMIView_Reports\*.*.*.*_drd-42942_SPORTSNET\bsalgado_2016-06-02_Processes_Report.csv""
SoftPerfect Support forum - Andrew avatar image

Re: Extra quotes in variables   03 June 2016, 12:09

I am afraid the network scanner is unable to parse such complex expressions with chained commands.

As a workaround you can change %NirSoft_VAR to something without a space, e.g. \PortableApps\WSCCPortable\App\WSCC\NirSoftUtilities and no quotes will be added.

Sometimes you can find a solution faster if you try the forum search, have a look at the knowledge base, or check the software user manual to see if your question has already been answered.

Our forum rules are simple:

  • Be polite.
  • Do not spam.
  • Write in English. If possible, check your spelling and grammar.

Author:

Subject

A brief and informative title for your message, approximately 4–8 words:

     

Spam prevention: please enter the following code in the input field below.

 **     **  **     **   ******    **     **        ** 
 ***   ***  **     **  **    **   **     **        ** 
 **** ****  **     **  **         **     **        ** 
 ** *** **  **     **  **   ****  *********        ** 
 **     **  **     **  **    **   **     **  **    ** 
 **     **  **     **  **    **   **     **  **    ** 
 **     **   *******    ******    **     **   ******  

Message: