The space problem of bat command writing

Source: Internet
Author: User

In recent projects there is a need to use the day batch function, and the application server is Windows, so I decided to use bat to achieve.

After the development test, placed on the test server OK, successful implementation of the day batch processing function.

Therefore, the weekend is deployed to the official server. Monday morning to see the next log record, the day of processing did not execute successfully, find the reason

The bat command does not correctly recognize the command you want to execute because it turns out to be a folder name with a name with a space in the path.

To avoid this ambiguity, enclose the path in quotation marks when the folder name has a space.


As shown below:

Before modification

C:
CD C:\Users\mid0001\Desktop\pdi-ce-4.4.0-stable\data-integration
kitchen.bat/norep-file=D:\ymsm TEST\YMSM-TEST.KJB
Exit

After modification

C:
CD C:\Users\mid0001\Desktop\pdi-ce-4.4.0-stable\data-integration
kitchen.bat/norep-file="D:\ymsm test\ymsm-test.kjb"
Exit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.