As part of a larger batch file that involves creating a directory with today's date, copying and pasting files to be backed up, changing privileges and deleting files older then X days, I've run into a problem. This is where I run into my problem:
Code: Select all
echo var D = new Date() > tmp.js
echo D = (D.getFullYear()*100+D.getMonth()+1)*100+D.getDate() >> tmp.js
echo WScript.Echo( 'set YYYYMMDD='+D ) >> tmp.js
echo @echo off > tmp.bat
cscript //nologo tmp.js >> tmp.bat
call tmp.bat
The weird thing is this runs fine on one machine on the network but fails on another. After that last line the command prompt spits back an error that looks like this:
Input Error: There is no file extension in "C:\Users\name\Desktop\Error: ".
Any help would be greatly appreciated.