Windows server 2003 Vs windows 2008 R2 batch file handling. RRS feed

  • Question

  • Hi,

    We recently replaced servers which ran win 2003 with news ones running Win 2008 R2 , there are scripts that used to run on win 2003 servers but now I am not able to get them to run correctly on the new servers.
    The script below used to move files from one location to another ,then use java to change to the files to some specific format before archiving them to an archive server. Trying to run this on Windows 2008 is not working.

    Could anyone help me to get this to work ? or what would powershell script look like ? I guess powershell script would be easier .

    rem Execute RenameFiles class 
    rem %1 is the location of the files
    rem %2 is today's date.
    rem %3 is the Path and file name of the zip file
    rem %4 is the pattern for the files that are to be moved.
    rem %5 is the file name of the zip file

    move "\\Fileserver1\output\XZ%4" %1
    move "\\Fileserver1\output\AB%4" %1
    move "\\Fileserver1\output\output\VX%4" %1

    C:\java\j2re1.8.0_91\bin\java.exe -classpath C:\Scrips\USA RenameFiles %1 %2
    "C:\Program Files (x86)\WinZip\wzzip" %3 %1\XZ*.* %1\AB*.* %1\VX*.* 
    copy %3 \\ArchiveServer\ArchiveFolder\%5

    Below are parameters I am passing: 

    %1   ---  > \\SharedFiles\Folder1\ 
    %2    ---  > <SysDate.YYMMDD> 
    %3      ---  > \\SharedFiles\Folder1\Filename<SysDate.YYMMDD>.zip 
    %4    ---  > *<SysDate.YYMMDD>*.* 
    %5     ---  > Filename<SysDate.YYMMDD>.zip 


    • Moved by jrv Tuesday, November 19, 2019 6:49 AM correct forum
    • Edited by samsock Tuesday, November 19, 2019 6:56 AM
    Tuesday, November 19, 2019 6:41 AM

All replies