Jump to content

Search the Community

Showing results for tags 'if exist'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • The General Stuff
    • Announcements
    • Introduce Yourself!
    • General Discussion
  • Microsoft Software Products
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows Server
    • Older Windows NT-Family OSes
    • Windows 9x/ME
    • Other Microsoft Products
  • Unattended Windows Discussion & Support
    • Unattended Windows
    • Other Unattended Projects
  • Member Contributed Projects
    • Nuhi Utilities
    • Member Projects
    • Other Member Contributed Projects
    • Windows Updates Downloader
  • Software, Hardware, Media and Games
    • Forum Categories
    • Mobile Devices
  • Customizing Windows and Graphics
    • Customizing Windows
    • Customizing Graphics
  • Coding, Scripting and Servers
    • Web Development (HTML, Java, PHP, ASP, XML, etc.)
    • Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
    • Server - Side Help (IIS, Apache, etc.)

Calendars

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype

Found 1 result

  1. Hi I'm doing a batch file that will check if ANY file exists in particular a directory. If so it creates an archive directory and archives said files before running the communications portion of the script to send and receive files. If no file exists it will use GOTO to jump directly to the communications. I need it to skip archiving if no files exist so that it does not create empty directories every time she task scheduler runs it. I know this will work if there is a file mask set, because I have tried it. My problem is that there is no real way to set any kind of file mask to look for (i.e. C:\filesout\partoffilename*.txt). The files that are being generated have no common naming convention. There is no way to change this in the app that creates the files. So I have tried (C:\filesout\*.*) This doesn't work as it runs the archive portion of the script even if no files exist. Any assistance would be greatly appreciated. Script below with comments. The part that's giving me issues is the (if exist "F:\EDIout\*.*") rem #####################rem #CD to EDI directory#rem #####################F:cd "F:\EDIout"rem ################################################################rem #First Check if files exist to be sent so we don't end up #rem #creating a bunch of empty directories. #rem #If not, bypass the archive step and go right to SND/RCV comms.#rem ################################################################if exist "F:\EDIout\*.*" (goto archive) else (goto comms):archiverem ########################rem #Set date and time Vars#rem ########################For /F "Tokens=1-7 Delims=/:. " %%d In ("%Date%%Time%") Do Set destDir=%%f-%%e-%%d_%%g.%%h.%%i.%%jrem #######################################rem #Check if dir exists. If not create it#rem #######################################if not exist "F:\EDIout\Archive\%destDir%" mkdir "F:\EDIout\Archive\%destDir%" rem ############################rem #copy files to tarchive dir#rem ############################copy "F:\EDIout\*.*" "F:\EDIout\Archive\%destDir%":commsrem #############################rem ## Comms Stuff goes next ##rem #############################
×
×
  • Create New...