|
w1314ich
中级用户
  
积分 234
发帖 119
注册 2007-4-22
状态 离线
|
『楼 主』:
[求助]如何把网卡地址和同一文件绑定
使用 LLM 解释/回答一下
单位里有一批机器,每台机器C盘的IP文件夹下有一个IPMAC.txt文件,每天下班后全部机器在6:00准时向主机发送IPMAC.txt文件来核对,我现在想把发送过来的IPMAC.txt文件在发送前都重命名,否则主机只能收到一个文件了,重命名的要求是IPMAC.txt→IPMAC(网卡物理地址).txt,然后把IPMAC(网卡物理地址).txt发到主机上,发送部分我会用批处理写,但不知道重命名部分如何用P写,请高手指点
There are a batch of machines in the unit. There is an IPMAC.txt file in the IP folder of the C drive of each machine. Every day after work, all machines send the IPMAC.txt file to the host at 6:00 on time for verification. Now I want to rename the received IPMAC.txt files before sending them, otherwise the host will only receive one file. The requirement for renaming is IPMAC.txt → IPMAC(MAC physical address of the network card).txt, and then send IPMAC(MAC physical address of the network card).txt to the host. I will write the sending part with a batch file, but I don't know how to use P to write the renaming part. Please ask the experts for guidance.
|
|
2008-1-26 16:11 |
|
|
slore
铂金会员
      
积分 5212
发帖 2478
注册 2007-2-8
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
for+findstr+ipconfig提取网卡地址
ren修改名字……
查看下提取IP的例子
Extract network card address using for + findstr + ipconfig
Renames...
Take a look at an example of extracting IP
|
|
2008-1-26 16:18 |
|
|
w1314ich
中级用户
  
积分 234
发帖 119
注册 2007-4-22
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
不怎么明白 能详细点吗
Not quite clearly. Can you elaborate in detail?
|
|
2008-1-27 13:38 |
|
|
w1314ich
中级用户
  
积分 234
发帖 119
注册 2007-4-22
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
有谁能帮帮我吗 急啊~~~ 快年终了 单位上等解决啊
Is there anyone who can help me? Urgent~~~ It's almost the end of the year. The unit is waiting to solve it.
|
|
2008-1-27 15:29 |
|
|
slore
铂金会员
      
积分 5212
发帖 2478
注册 2007-2-8
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
@echo off
echo 网卡地址为:
for /f "tokens=1,3 delims=:. " %%i in ('ipconfig /all') do (
if "%%i"=="Physical" (Set Mac=%%j&&goto :ExitFor)
)
:ExitFor
echo ren IPMAC.txt --^> IPMAC(%Mac%).txt
pause>nul
@echo off
echo The MAC address is:
for /f "tokens=1,3 delims=:. " %%i in ('ipconfig /all') do (
if "%%i"=="Physical" (Set Mac=%%j&&goto :ExitFor)
)
:ExitFor
echo ren IPMAC.txt --^> IPMAC(%Mac%).txt
pause>nul
|
|
2008-1-27 16:17 |
|
|
w1314ich
中级用户
  
积分 234
发帖 119
注册 2007-4-22
状态 离线
|
|
2008-1-27 18:21 |
|
|
diangongban
初级用户
 
积分 61
发帖 32
注册 2007-5-11
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
发送部分批处理发上来分享分享
Post some batch scripts for sharing
|
|
2008-2-2 10:09 |
|
|
w1314ich
中级用户
  
积分 234
发帖 119
注册 2007-4-22
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
发送部分(接收主机需要开放FTP服务):
@echo off
echo open 192.168.0.2(主机地址)>c:\ftp.txt
echo 123(ftp帐号)>>c:\ftp.txt
echo 123(ftp密码)>>c:\ftp.txt
echo put C:\ip\IPMAC.txt>>c:\ftp.txt
echo bye>>c:\ftp.txt
ftp -s:c:\ftp.txt
del c:\ftp.txt
Sending part (the receiving host needs to have FTP service enabled):
@echo off
echo open 192.168.0.2(host address)>c:\ftp.txt
echo 123(ftp account)>>c:\ftp.txt
echo 123(ftp password)>>c:\ftp.txt
echo put C:\ip\IPMAC.txt>>c:\ftp.txt
echo bye>>c:\ftp.txt
ftp -s:c:\ftp.txt
del c:\ftp.txt
|
|
2008-2-5 18:28 |
|
|
qq43142691
中级用户
  
积分 327
发帖 152
注册 2007-5-4
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
可以开个可以写的权限的共享就可以了。。干嘛要用外网啊。。。。
这个其实很简单的。。你可以参考我之前发过的那个根据MAC改IP的批处理就可以得到启发了。。。原理基本一样的。。。
It's okay to open a share with write permissions. Why use the external network?? This is actually very simple. You can get inspiration by referring to the batch script for changing IP based on MAC that I posted before. The principle is basically the same.
|
|
2008-2-6 05:11 |
|
|
sbyywf
新手上路

积分 17
发帖 6
注册 2008-9-22
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
与楼主有相同的想法,试试slore的方法。谢谢啦!
Have the same idea as the LZ, try the slore method. Thanks!
|
|
2010-11-18 16:19 |
|
|
shengping
初级用户
 
积分 23
发帖 12
注册 2006-2-12
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
如果有多张网卡, 五楼的方法就失效了.
If there are multiple network cards, the method on the fifth floor will be invalid.
|
|
2010-12-18 18:09 |
|