Automatically delete files

Page 2 of 2 FirstFirst 12

  1. Posts : 11
    Windows 7 Ultimate x64
    Thread Starter
       #11

    Still can't get it working

    Here is the content of my delete.bat

    CD \\DISKSTATION\BackupFolder\BeyondTv

    del /q *.dat
    del /q *.index
    del /q *.timeindex
    del /q *.header
    del /q *.index.dat



    Command prompt:

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Users\Lawrence>\\DISKSTATION\BackupFolder\BeyondTv\delete.bat

    C:\Users\Lawrence>CD \\DISKSTATION\BackupFolder\BeyondTv
    '\\DISKSTATION\BackupFolder\BeyondTv'
    CMD does not support UNC paths as current directories.

    C:\Users\Lawrence>del /q *.dat

    C:\Users\Lawrence>del /q *.index
    Could Not Find C:\Users\Lawrence\*.index

    C:\Users\Lawrence>del /q *.timeindex
    Could Not Find C:\Users\Lawrence\*.timeindex

    C:\Users\Lawrence>del /q *.header
    Could Not Find C:\Users\Lawrence\*.header

    C:\Users\Lawrence>del /q *.index.dat
    Could Not Find C:\Users\Lawrence\*.index.dat

    C:\Users\Lawrence>
      My Computer


  2. Posts : 450
    Windows 7
       #12

    Bigsplash said:
    Still can't get it working

    Here is the content of my delete.bat

    CD \\DISKSTATION\BackupFolder\BeyondTv

    C:\Users\Lawrence>
    Originally (prior post in this thread) you had this:

    CD C:\RecordedTV



    In your script shown above, CD \\DISK..... the double-backslash \\ is to denote a NETWORK drive/path. In your test above, you can prove your CD (Change Directory) command did not work because the command prompt shown after each unsuccessful del /q command still has:

    C:\Users\Lawrence>



    The format for your path should be:

    logicaldrive:\directorynode1\directorynode2\..... - see above CD C:\RecordedTV


    It sounds like you want:

    CD C:\DISKSTATION\BackupFolder\BeyondTv



    Let's say you were in DOS and had your current directory pointing your F drive, your command prompt would show this:

    F:\>

    If you issued the CD C:\DISK..... command above it would not work. You need to add a / switch to the DIR command to tell it that you are not just changing the current working directory PATH, but are also changing the drive.

    CD /D C:\DISKSTATION\BackupFolder\BeyondTv



    If you only have your C drive/partition, no need to have the /D option in there on the CD command.
    Last edited by JimLewandowski; 12 Jan 2012 at 15:53.
      My Computer


  3. Posts : 11
    Windows 7 Ultimate x64
    Thread Starter
       #13

    Thanks for all your patient help!

    Diskstation actually is referring to my synology network attached storage, which is connected to my router via cat 6 cable.

    Is it still possible to make this work?

    What kind of command would I need at the command prompt to change to the NAT drive?
      My Computer

  4.   My Computer


 
Page 2 of 2 FirstFirst 12

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 01:27.
Find Us