none
Please help getting error Input Error: There is no file extension in "C:\Error:". when executing batch file RRS feed

  • Question

  • Hi all,

         We wrote a schedule which will execute a batch file ,the batch file containing the commands to copy the file (file name is previous day date) from one folder to another folder from there will do the remaining process.But we are getting error

    There is no file extension in "C:\Error:".

    when we are trying to test the batch file.commands in batch file as follows

     

    @echo off
    set TmpFile="%temp%.\tmp.vbs"
    echo> %TmpFile% n=Now
    echo>>%TmpFile% With WScript
    echo>>%TmpFile% .Echo "set year=" + CStr(Year(n-1))
    echo>>%TmpFile% .Echo "set day=" + Right(100+Day(n-1),2)
    echo>>%TmpFile% .Echo "set month="+ Right(100+Month(n-1),2)
    echo>>%TmpFile% End With
    cscript //nologo "%temp%.\tmp.vbs" > "%temp%.\tmp.bat"
    call "%temp%.\tmp.bat"
    del "%temp%.\tmp.bat"
    del %TmpFile%
    echo %year%%month%%day%
    cd\
    C:
    cd C:\Journal
    copy C:\Journal\%year%%month%%day%.jrn c:\path1
    exit


    thanks in advance 

     

    Friday, November 25, 2011 5:03 AM

Answers

  • Hello

    The batch script works fine for me. Can you open Start => Run => Regedit, go to HKEY_CLASSES_ROOT\VBSFile\Shell\Open\Command and make sure that the (Default) key has this value inside:

    %SystemRoot%\System32\WScript.exe "%1" %*

    Also, can you make sure that the schedule task correctly calls the batch file? If its "Run" or "Start in" values have spaces inside, you will have to use quotes, like you did inside the script.

    Plus, at line 9 you can use %TmpFile% since you have already set it.

    Good luck.

     

    Konstantinos

    Friday, November 25, 2011 5:17 PM

All replies

  • Hello

    The batch script works fine for me. Can you open Start => Run => Regedit, go to HKEY_CLASSES_ROOT\VBSFile\Shell\Open\Command and make sure that the (Default) key has this value inside:

    %SystemRoot%\System32\WScript.exe "%1" %*

    Also, can you make sure that the schedule task correctly calls the batch file? If its "Run" or "Start in" values have spaces inside, you will have to use quotes, like you did inside the script.

    Plus, at line 9 you can use %TmpFile% since you have already set it.

    Good luck.

     

    Konstantinos

    Friday, November 25, 2011 5:17 PM
  • Thanks a lot .....
    Thursday, December 1, 2011 7:26 AM