Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: need help -dos script  (Read 3656 times)

0 Members and 1 Guest are viewing this topic.

alvaramya

  • Guest
need help -dos script
« on: June 05, 2010, 12:20:49 AM »
To check the file is 0 kb in particular directory
if the file is 0 kb display it and call the corresponding script to re-run it
if the file is not  0  kb then exit
   

Salmon Trout



    Genius

    Thanked: 965
    • Yes
  • Computer: Specs
  • Experience: Experienced
  • OS: Other
Re: need help -dos script
« Reply #1 on: June 05, 2010, 01:31:46 AM »
Code: [Select]
set filename=somefilename.ext
set folder=d:\path\folder
set script=d:\path\script.cmd
for /f "delims=" %%A in ("%folder%\%filename%") do set filesize=%%~zA
if %filesize% NEQ 0 call "%script%"

Salmon Trout



    Genius

    Thanked: 965
    • Yes
  • Computer: Specs
  • Experience: Experienced
  • OS: Other
Re: need help -dos script
« Reply #2 on: June 05, 2010, 03:47:18 AM »
Correction

Code: [Select]
set filename=somefilename
set folder=d:\path\somefolder
set script=d:\path\somescript
for /f "delims=" %%A in ("%folder%\%filename%") do set filesize=%%~zA
if %filesize% EQU 0 (
    echo %filename% 0 bytes
    call "%script%"
    )