Solved

Editing a batch file using double quotes

Posted on 2008-10-07
1
1,151 Views
Last Modified: 2012-05-05
I am currently creating a batch file in windows to schedule a task. The task I want to schedule is to run a VBS file which works if i create it in windows. When I run the batch file It adds in the scheduled task no problem but run box needs to have "runcommand" and the quotation marks arent there. this is because in the batch file it allready has them round this command but this is to get SCHTASKS.exe to work with a file. Basically what I need to know is, is there a way I can have double quotation marks in a batch file. Ive tried typing this but it just upsets the SCHTASKS.exe command and the batch file.
0
Comment
Question by:hmuser
1 Comment
 
LVL 31

Accepted Solution

by:
Paranormastic earned 125 total points
ID: 22661970
I'm not quite sure I'm reading your question right, so I will answer a couple of very different ways.

I believe you are asking if you can use the character " in a batch file - yes you can.  Careful to actually type it in instead of copying as sometimes copying from Word, etc. may give you curly quotes, aka smart quotes, instead of the standard straight quotation marks.  These curly quotes are non-standard characters and will give you a major headache.

Anytime you need quotes around something you could be able to do the entire command and then unquote, then quote again for the next necessary place.  Quotes twice in the same area should not be needed.  Also, sometimes you may need to do a whole file path in quotes, sometimes it may be better to not.
"%userprofile%" is one trick where when it converts this variable to the actual c:\docs and settings\username it will have spaces, which is bad, but by putting the variable in you get that in quotes so its happy again.  this can be done
"%userprofile%"\folder1\"folder two"  or "%userprofile%\folder1\folder two" - usually the latter works better if you need two in the same path.

If you need more help, it may be useful to post or upload the code example for more direct comment.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now