Jump to content

Simple script needing continuous loop


Recommended Posts

I have just downloaded AutoIt.

I have a simple script that I'm looking to automate when it sees a particular file in the directory.

The script below renames the file, and then moves it into another folder.

for /f "Tokens=1-4 Delims=/ " %%a in ('date /t') do set SortDate=%%c%%a%%b

for /f "Tokens=1-2 Delims=: " %%a in ('time /t') do set SortTime=%%a%%b

ren upload.php upload_%SortDate%_%SortTime%.php

Move upload*.php Archive

How would I go about getting the script to look at the directory every 30 seconds to see if the upload.php file exists, then execute the script automatically?

Please help.

Newbie

Link to comment
Share on other sites

While 1
Sleep(30000)
If FileExists("upload.php") then Run("script.bat")
WEnd

change upload.php and script.bat to reflect there actual locations.

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
Link to comment
Share on other sites

I have just downloaded AutoIt.

There we go again. You've just downloaded AutoIt and you don't know how to do anything in it. So what is the first thing you do? Of course, ask the community! The community's probably bored out of their minds, they could use someone like me. I have a lot of scripts to be written and with some luck I can make the community do everything for me.

In all seriousness, if you've just downloaded AutoIt then your first task is to learn AutoIt. Not ask the community to write your stuff for you.

Link to comment
Share on other sites

There we go again. You've just downloaded AutoIt and you don't know how to do anything in it. So what is the first thing you do? Of course, ask the community! The community's probably bored out of their minds, they could use someone like me. I have a lot of scripts to be written and with some luck I can make the community do everything for me.

In all seriousness, if you've just downloaded AutoIt then your first task is to learn AutoIt. Not ask the community to write your stuff for you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...