Pages:
Author

Topic: [CLOSED] Simple script required - payment in btc (Read 1917 times)

sr. member
Activity: 364
Merit: 250
February 14, 2012, 02:35:56 AM
#21
I have found BATCH ONLY solution for this problem.
Thanks every1 for the input.

Edit: As requested, I am posting the link
http://stackoverflow.com/questions/7618210/search-by-seconds-not-minutes
legendary
Activity: 1260
Merit: 1000
Drunk Posts
If you can install software, you cal always use the above script i posted, just install powershell (http://support.microsoft.com/kb/968929 ) and make a batch file with "powershell -File aboveScript.ps1"
newbie
Activity: 17
Merit: 0
My solution would be a small c++ program that outputs every file in a given directoy that's older than 2 minutes. You would have to place this program somewhere in your $PATH. Then you would be able to create a batch file that simply copies each file somewhere. Do you have access to your machine in a way to install programs (I mean, just putting an .exe in your windows folder)?
hero member
Activity: 576
Merit: 514
Write the program in any language you want and compile it if needed.
Then just call it from within a batch script by using "START".
Or maybe I don't see your problem here...
sr. member
Activity: 364
Merit: 250
Not sure if this will work for you, but it copies all files every 2 minutes (120 seconds) 720 times (1 day), regardless of age. You can then set the batch to run with windows task manager once a day.

@echo off
 for /L %%a in (1,1,720) do (
 xcopy /d /y /c c:\folder1\*.* c:\folder2\
 ping localhost -n 120 > nul
 )

This is kind of scheduler, but I already have scheduled job running via control m.
I want 2 min old files to be copied.
full member
Activity: 140
Merit: 100
BTW, in which language can you make exe?
Also, source will be available?

For little utilities like this I use a language called purebasic (see www.purebasic.com for details) It's a great language to use for any small tools that you want written quickly.

And yes, source code would be available Smiley
legendary
Activity: 924
Merit: 1000
Think. Positive. Thoughts.
Not sure if this will work for you, but it copies all files every 2 minutes (120 seconds) 720 times (1 day), regardless of age. You can then set the batch to run with windows task manager once a day.

@echo off
 for /L %%a in (1,1,720) do (
 xcopy /d /y /c c:\folder1\*.* c:\folder2\
 ping localhost -n 120 > nul
 )
sr. member
Activity: 364
Merit: 250
BTW, in which language can you make exe?
Also, source will be available?
full member
Activity: 140
Merit: 100
Can you do it in batch?
How much will you charge for that?

To be honest, I'm not 100% sure that I would be able to do it as a batch file, it's been a long time since I've done any proper batch file creation (since I usually just write programs to do things these days)

If I find a solution, I will let you know
sr. member
Activity: 364
Merit: 250
Can you do it in batch?
How much will you charge for that?
full member
Activity: 140
Merit: 100
An exe file is different. It's a complied program rather than a script.

There probably IS a way to do it with a .bat file, but I don't think it will be as simple as it seems
sr. member
Activity: 364
Merit: 250
I assume if exe can be made, batch can also be made with same commands, right?
full member
Activity: 140
Merit: 100
If you can run bat files you should be able to run exe files.

If you can't do it directly then you could always put the exe file on the machine and then run it from a bat
sr. member
Activity: 364
Merit: 250
I want to run from Control M software.
I have never executed exe, only bat and sh files

Is there much difference between exe and bat files?
full member
Activity: 140
Merit: 100
Any particular reason you want it to be a batch script rather than a simple exe file?
(If you would be happy with an exe I can make you one in about 2 or 3 mins)
sr. member
Activity: 364
Merit: 250
Already tried that, doesnt work.
full member
Activity: 154
Merit: 102
Bitcoin!
sr. member
Activity: 364
Merit: 250
Bump

Any1?
sr. member
Activity: 364
Merit: 250
Sorry, require simple batch script, not powershell.

I want to run the script on Windows Server 2003.
legendary
Activity: 1260
Merit: 1000
Drunk Posts
Not particulrly good with batch files, but if your running on Vista or 7, this powershell script should do it.

$files=get-childitem .
$date = get-date
$date = $date.AddMinutes(-2)
foreach ($file in $files) {
   if ($date -lt $file.LastWriteTime) {
      copy $file dir\
   }
}
Pages:
Jump to: