Bitcoin Forum
December 09, 2016, 08:12:08 AM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1] 2 »  All
  Print  
Author Topic: [CLOSED] Simple script required - payment in btc  (Read 1570 times)
bitcoinTrader
Sr. Member
****
Offline Offline

Activity: 364


View Profile
February 13, 2012, 04:40:35 AM
 #1

Hi,

I require simple windows batch script to do the following:

If the file is older than 2 minutes in a particular folder, copy the file to another location.

Should be easy job.

Please post here or PM.

Thanks!


1481271128
Hero Member
*
Offline Offline

Posts: 1481271128

View Profile Personal Message (Offline)

Ignore
1481271128
Reply with quote  #2

1481271128
Report to moderator
1481271128
Hero Member
*
Offline Offline

Posts: 1481271128

View Profile Personal Message (Offline)

Ignore
1481271128
Reply with quote  #2

1481271128
Report to moderator
1481271128
Hero Member
*
Offline Offline

Posts: 1481271128

View Profile Personal Message (Offline)

Ignore
1481271128
Reply with quote  #2

1481271128
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481271128
Hero Member
*
Offline Offline

Posts: 1481271128

View Profile Personal Message (Offline)

Ignore
1481271128
Reply with quote  #2

1481271128
Report to moderator
mb300sd
Legendary
*
Offline Offline

Activity: 1232

Drunk Posts


View Profile WWW
February 13, 2012, 04:58:31 AM
 #2

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\
   }
}

1D7FJWRzeKa4SLmTznd3JpeNU13L1ErEco
bitcoinTrader
Sr. Member
****
Offline Offline

Activity: 364


View Profile
February 13, 2012, 05:20:17 AM
 #3

Sorry, require simple batch script, not powershell.

I want to run the script on Windows Server 2003.

bitcoinTrader
Sr. Member
****
Offline Offline

Activity: 364


View Profile
February 13, 2012, 07:08:26 AM
 #4

Bump

Any1?

btc_artist
Full Member
***
Offline Offline

Activity: 154


Bitcoin!


View Profile WWW
February 13, 2012, 07:26:41 AM
 #5

Google is your friend. This should work with minor modifications:

http://stackoverflow.com/questions/3185489/dos-batch-file-for-copy-files-older-than-30-minute-from-one-forder-to-other-fold

BTC: 1CDCLDBHbAzHyYUkk1wYHPYmrtDZNhk8zf
LTC: LMS7SqZJnqzxo76iDSEua33WCyYZdjaQoE
bitcoinTrader
Sr. Member
****
Offline Offline

Activity: 364


View Profile
February 13, 2012, 08:42:47 AM
 #6

Already tried that, doesnt work.

BinoX
Full Member
***
Offline Offline

Activity: 140


Firstbits: 14tyj3


View Profile
February 13, 2012, 01:38:37 PM
 #7

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)

Please give generously Wink
BTC: 14tyJ34vPEZ22LtkeJsMGPY2oBKq9VgGkE
NMC: N8tkdgUFYWRcLKtZnPv3or1gnPtgPG29Mv
bitcoinTrader
Sr. Member
****
Offline Offline

Activity: 364


View Profile
February 13, 2012, 02:17:13 PM
 #8

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?

BinoX
Full Member
***
Offline Offline

Activity: 140


Firstbits: 14tyj3


View Profile
February 13, 2012, 02:21:03 PM
 #9

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

Please give generously Wink
BTC: 14tyJ34vPEZ22LtkeJsMGPY2oBKq9VgGkE
NMC: N8tkdgUFYWRcLKtZnPv3or1gnPtgPG29Mv
bitcoinTrader
Sr. Member
****
Offline Offline

Activity: 364


View Profile
February 13, 2012, 02:27:54 PM
 #10

I assume if exe can be made, batch can also be made with same commands, right?

BinoX
Full Member
***
Offline Offline

Activity: 140


Firstbits: 14tyj3


View Profile
February 13, 2012, 02:30:42 PM
 #11

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

Please give generously Wink
BTC: 14tyJ34vPEZ22LtkeJsMGPY2oBKq9VgGkE
NMC: N8tkdgUFYWRcLKtZnPv3or1gnPtgPG29Mv
bitcoinTrader
Sr. Member
****
Offline Offline

Activity: 364


View Profile
February 13, 2012, 02:32:37 PM
 #12

Can you do it in batch?
How much will you charge for that?

BinoX
Full Member
***
Offline Offline

Activity: 140


Firstbits: 14tyj3


View Profile
February 13, 2012, 02:36:00 PM
 #13

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

Please give generously Wink
BTC: 14tyJ34vPEZ22LtkeJsMGPY2oBKq9VgGkE
NMC: N8tkdgUFYWRcLKtZnPv3or1gnPtgPG29Mv
bitcoinTrader
Sr. Member
****
Offline Offline

Activity: 364


View Profile
February 13, 2012, 02:46:54 PM
 #14

BTW, in which language can you make exe?
Also, source will be available?

eroxors
Hero Member
*****
Offline Offline

Activity: 756


Think. Positive. Thoughts.


View Profile
February 13, 2012, 04:38:48 PM
 #15

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
 )

Don't get caught up in the game and have a nice day!
BinoX
Full Member
***
Offline Offline

Activity: 140


Firstbits: 14tyj3


View Profile
February 13, 2012, 05:22:54 PM
 #16

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

Please give generously Wink
BTC: 14tyJ34vPEZ22LtkeJsMGPY2oBKq9VgGkE
NMC: N8tkdgUFYWRcLKtZnPv3or1gnPtgPG29Mv
bitcoinTrader
Sr. Member
****
Offline Offline

Activity: 364


View Profile
February 13, 2012, 05:32:00 PM
 #17

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.

Bitsky
Hero Member
*****
Offline Offline

Activity: 542


View Profile
February 13, 2012, 05:56:47 PM
 #18

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...

Bounty: Earn up to 68.7 BTC
Like my post? Feel free to drop a tip to 1BitskyZbfR4irjyXDaGAM2wYKQknwX36Y
gutschilla
Newbie
*
Offline Offline

Activity: 19



View Profile
February 13, 2012, 07:57:25 PM
 #19

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)?
mb300sd
Legendary
*
Offline Offline

Activity: 1232

Drunk Posts


View Profile WWW
February 14, 2012, 02:43:43 AM
 #20

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"

1D7FJWRzeKa4SLmTznd3JpeNU13L1ErEco
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!