set "ymd=%date:~,4%%date:~5,2%%date:~8,2%"
md %ymd%
echo >%ymd%\1.txt
echo >%ymd%\2.txt
echo >%ymd%\3.txt
echo >%ymd%\1.html
echo >%ymd%\2.html
echo >%ymd%\3.html
pause
move %ymd% pass
pause
bat----exe 带参数运行
c程序 调用exe bat
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int x=0;
// system(argv[0]);
system("exe.exe main.bat");
cin>>x;
return 0;
}
·2
---------------------
main.exe-->main.bat
main.exe-->exe.exe-->main.bat
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int a[10];
ofstream outfile("main.bat",ios::out);
if (!outfile)
{
cerr<<"open error"<<endl;
exit(1);
}
outfile<<"echo wzzx"<<endl;
outfile<<"start http://www.baidu.com"<<endl;
outfile<<"pause"<<endl;
outfile.close();
system("exe.exe");
return 0;
}
原文地址:http://wzsts.blog.51cto.com/10251779/1833392