Jump to content

Iniread then file move probleam


Recommended Posts

Hi everyone~

I need help

I got one Server and ten PC. PC boot from Server and bring the common file.

this is my question.

I want file move to ten pc each diffent file. I mean

ex)   01PC    d:\example1/config.exe → c:\example1\config.exe

        02PC    d:\example2/config.exe → c:\example2\config.exe

        03PC    d:\example3/config.exe → c:\example3\config.exe

        04PC    d:\example1/config.exe → c:\example1\config.exe

        05PC    d:\example3/config.exe → c:\example3\config.exe

I made INI file

[example1]

pc001=00-25-23-F8-B6-74

pc004=BC-5F-F4-3D-08-75

[example2]

pc002=BC-5F-F4-6D-7B-B2

[example3]

pc003=BC-2F-F4-0D-08-54

pc005=00-25-25-F8-B6-88

Pc mac address check and file move to each pc.

My english suck.. I hope understand my explane. thz

 

 

 

 

Link to comment
Share on other sites

I would structure the INI file like this:

[PCCheck]
00-25-23-F8-B6-74=example1
BC-5F-F4-3D-08-75=example1
BC-5F-F4-6D-7B-B2=example2
BC-2F-F4-0D-08-54=example3
00-25-25-F8-B6-88=example3

And the script would be something like this:

$iniFile = @ScriptDir & "\config.ini"
$thisPCMAC = "BC-5F-F4-6D-7B-B2"
$compCopy = IniRead($iniFile, "PCCheck", $thisPCMAC, "Not Found")
FileCopy("d:\" & $test & "\config.exe", "c:\" & $test & "\config.exe")

 

Just to note, I think there are better ways of doing this such as embedding all the configurations in one config.exe. To do this, I would make each configuration a function and call up the correct one by the MAC address. This would allow you to have only one config.exe instead of multiple ones.

Edited by abberration
Missed a parenthesis
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...