Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 468 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
using the DOS start command when passed arguments have quotes

#1
I have a question about the DOS start command.
I have already read this topic:
Using the DOS “start” command with parameters passed to the started program

[To see links please register here]


but my question is a little different.

I have this problem: I need to pass paths that need to be quoted.

For example, if path have no quotes this works fine:

start "" app.exe -option c:\myapp\myfile.txt

but if path have double quotes it doesn't works.

I have this line in my BATCH file:

start "" myapp.exe -option %mypath%

and when %mypath% contains double quotes (paths that have spaces or other characters in names) the start command returns very strange results.






Thanks
Sandro
Reply

#2
This might help, but it is a **bit way round about** method and slight modification may required to suit your need.

The idea is to:

1. Dump the environment variable which has quotes to a text file with a predefined name. Like:"set mypath2 > withQt.bat"
2. Use windows [power shell][1] or some third party tool to find and replace quotes in that file.
3. Create another text file (one time step only) containing string "Set "
4. Use copy command to append the file mentioned in step2 with the file created in step3 and create a batch file with a predefined name. Like: copy base.bat + withQt.bat withtqt.bat
5. Run the batch file, which creates another/replaces the environment variable with value without quotes.

Sorry, I couldn't get something more elegant at this time.

[1]:

[To see links please register here]

Reply

#3
Normally it's not a problem to use parameters there with quotes, but you get problems if your app-path has also quotes.

Then you need to add an extra `CALL` statement.

start "" app.exe -option c:\myapp\myfile.txt - Works
start "" app.exe -option "c:\myapp\myfile.txt" - Works
start "" "app.exe" -option c:\myapp\myfile.txt - Works

start "" "app.exe" -option "c:\myapp\myfile.txt" - Don't works
start "" CALL "app.exe" -option "c:\myapp\myfile.txt" - Works

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through