Jump to content

anthony_field

Member
  • Posts

    8
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Australia

About anthony_field

  • Birthday 04/28/1977

Contact Methods

  • Website URL
    http://

anthony_field's Achievements

0

Reputation

  1. Your comments were fair, although as for the Paid/Unpaid blip- this is not the case.. I do however intend on using it in buisness, is there a more appropriate forum that I should post on ? I have tried several versions of this code, to try and get something working, although through my efforts have not been successfuyl. I do indeed see your comments as fair and have removed this topic, until I can upload my attemps to request others to help me with it. I assure you there is no financial gain from either of my POSTs I am sorry if your assistance in my other post was not recignised, although I did think that I had responded to all posts, I was very pleased with your assistance. It gave me the desired result... ( This was indeed a home/personal project ), until your .vbs I had only asperations of using .bat, I had no idea how .vbs worked, I am very interested. Thanks
  2. I actually need the copied / moved lock.dat to be processed by the server, it then disapears. then the next file can be moved. I need the Files that are waiting to be copied/moved to be deleted once successfully It also seems to move the .vbs script into the _upload folder, when infact I need it to remain in it original folder. Many Thanks for your help... Got it... "Const OverWrite = True Dim Fso :Set Fso = CreateObject("Scripting.FileSystemObject") On Error Resume Next Dim C1, F1, F2, StrDestination, ZZ1 Set F1 = Fso.GetFolder(".") StrDestination = "C:\lock_move\" Do For Each F2 In F1.Files If Not F2.Path = WScript.ScriptFullName Then If Not Fso.FileExists(StrDestination & "lock.dat") Then C1 = C1 +1 '-> This Copies Each File To This Name lock.dat Fso.CopyFile F2.Path,StrDestination & "lock.dat", OverWrite F2.Delete End If End If If C1 = 10 Then ZZ1 = MsgBox("Did you want to let the script run for 15 minutes more?",4132,"Quit Or Continue") If ZZ1 = 6 Then C1 = 0 If ZZ1 = 7 Then WScript.quit End If '-> Stop The Script For Approx 90 Seconds WScript.Sleep 10000 Next Loop Until C1 = 10" Works Great
  3. sorry last thing... I need the file to be moved as lock.dat not its original name of lock1.dat and so on... thanks
  4. Thats Perfect... Can this VB script Move the file instead of Copy ?
  5. Thanks "Gunsmokingman" Athough I can not seem to run this script... have saved it as lockscript.bat It does not seem to run. Any Ideas ? Const OverWrite = True Dim Fso :Set Fso = CreateObject("Scripting.FileSystemObject") On Error Resume Next Dim C1, F1, F2, StrDestination, ZZ1 Set F1 = Fso.GetFolder(".") StrDestination = "C:\lock_upload\" Do For Each F2 In F1.Files If Not F2.Path = WScript.ScriptFullName Then C1 = C1 +1 Fso.CopyFile F2.Path,StrDestination & F2.Name, OverWrite End If If C1 = 10 Then ZZ1 = MsgBox("Did you want to let the script run for 15 minutes more?",4132,"Quit Or Continue") If ZZ1 = 6 Then C1 = 0 If ZZ1 = 7 Then WScript.quit End If '-> Stop The Script For Approx 90 Seconds WScript.Sleep 90000 Next Loop Until C1 = 10
  6. I will try to be clear this time.. Sorry for the confusion.. I have c:\lock_files containing lock.dat lock1.dat lock2.dat ext upto possibly as high as 1000 (sometimes it may only be 100 entries) these files look like P|1879006546|C|First last|3yOR|||||300609|2359 P|1879002248|C|First Last|3yOR|||||300609|2359 P|1878002250|C|First Last |Ord|||||300608|2359 Each person starts on a new line. I do not wish them to append each other on the move. Now I wish to move these file ( one at a time ) as lock.dat to c:\lock_upload I need the batch to check to see if the destination file exists, if it does wait a desired amount of time then try again and then try again and so on. Until all the files in the c:\lock_files are moved successfully. This Batch file can just loop forever once started. a majority of the time though, the c:\lock_files directory will not contain any files, in this instance it should just wait until there is files to move. Hope this covers it all.. I appreciate your assistance. Thanks
  7. This script works well. Thanks. But it does not have the ability to move only one of the lock files at a time, and wait until it has been processed, then move the next one. It appears to over write the the moved lock.dat file in the destination directory. Can a wait statment be added and if file exists wait until ?
  8. HEY ALL.. I need a Script or Batch file that can do the following .... I have say 100 uniquly named files in one directory named ( lock.dat lock1.dat lock2.dat ) and so on...under c:\lock_files\ I need to copy these files to another directory on the same PC c:\lock_upload\ What I need is the script/Batch to move on of the 100 unique files at a time to the destination dir \lock_upload\ buy move it as a new file name lock.dat then I need the process to wait either a defined time for the next move, or identify if the Lock.dat file exists in the destination dir then move the next file as lock.dat and so on until all files have been moved as lock.dat to the destination dir. if no files are left to copy just wait until there is then start again. / or exit .. Until I start it manually again. I need it like this, as I have 10000 lines of txt that require uploading into a data base, that scans every one min for the lokc.dat file, as the process takes a long time, I split the files up to process them more quickly, but it is entirly painful moving them manually each time. Please help.
×
×
  • Create New...