Home > Software engineering >  Using VB to write a may, according to the file copying software
Using VB to write a may, according to the file copying software

Time:09-21

Detailed problems

I want to do a test called logfile backup,
Logfile formats such as ABC - MCUpass123. TXT ABC - MCUfail123. TXT

A: the test results appear in the c: \ logfile
B: would you like to save in two places, one is D: \ backup, one is the \ \ server \ logfile
C: there are two action, one is to copy a to d: \ backup, one is moving to \ \ server \ logfile, makes the C: \ logfile is empty. Hope files can not lost when the (mobile)
D: the string specified file can be copied to the D: \ backup \ MCUpass and D: \ backup \ MCUfail, and fail file does not move to \ \ server \ logfile, as long as the mobile pass to \ \ server \ logfile,
E: can do cycle replication, is open once, will automatically copy the files.

CodePudding user response:

Batch processing can also, thank you

CodePudding user response:

Problem solved?

CodePudding user response:

refer to the second floor a toast to invite the bright moon response:
problem solved?
no, could you help me

CodePudding user response:

Your article 4, the first half of the sentence I don't understand is what meaning,
"The specified string file is copied to the D: \ backup \ MCUpass and D: \ backup \ MCUfail", what mean?
Refers to the MCUpass * * * * * * * * * * *. TXT copied to D: \ backup \ MCUpass;
The * * * * * * * MCUfail * * * * * *. TXT copied to D: \ backup \ MCUfail?

And another one is:
1. A: test results appear in the c: \ logfile
How do I know it when the "test result output complete"?
To copy, move files, the output will have to wait for it to complete, close the file after, to operate,
2. The output logfile file you will have to "once the file" overlapping names?

CodePudding user response:

Just suddenly thought of a way, may know when it completed "output",


But still want to know after verified the exact result,

CodePudding user response:

This should be simple, write a program and then deal with regularly, and it can generate log

CodePudding user response:

Fyi:
 ServerShare="\ \ 192.168.3.56 \ d $" 
The UserName="somedomain \ someuser"
Password="somepassword"

The Set NetworkObject=CreateObject (" work "WScript.Net

NetworkObject. MapNetworkDrive ", "ServerShare, False, UserName, Password,"

The Set of FSO=CreateObject (" Scripting. FileSystemObject ")
Set the Directory=FSO. GetFolder (ServerShare)
For Each FileName In the Directory. The Files
WScript. Echo FileName. The Name
Next
Set the FileName=Nothing
Set the Directory=Nothing
The Set of FSO=Nothing

NetworkObject. RemoveNetworkDrive ServerShare, True, False

The Set NetworkObject=Nothing

CodePudding user response:

The format of the file?
Don't know how to distinguish between you FAIL and success.

CodePudding user response:

Thank you to offer, has been solved, since there is a problem to consult you

CodePudding user response:

Search "robocopy"
  • Related