无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
查看: 7825|回复: 14

[求助] pxe自动启动批处理文件“pxeautorun”如何自动运行?

[复制链接]
发表于 2019-5-3 18:16:02 | 显示全部楼层 |阅读模式
本帖最后由 dawnstar 于 2019-5-3 19:25 编辑

想把这个pxe自动启动批处理文件“pxeautorun”加到自己的PE里面,让其自动运行。可是研究了一天,发现pxeautorun自动下载到PE里面的'WINDOWS"文件夹里面的“system32"文件夹里面,保存的文件名是IP地址。比如”192.168.1.113.cmd。IP地址是PXE服务器的IP地址。是不固定的。如何才能启动这个cmd文件呢,希望得到大家的帮助。谢谢。
或者换个思路,怎么保存一个文件在PXE网络启动的服务端,然后客户机网启成功后自动运行这上批处理文件?
发表于 2019-5-3 20:22:47 | 显示全部楼层
@echo off & setlocal enabledelayedexpansion
for /f "tokens=1 delims=[]" %%a in ('nbtstat -S^|find /n "本地连接"') do (
    nbtstat -S | more +%%a >$
    set /p Str=<$
    del $
    for /f "tokens=2 delims=[]" %%a in ('echo "!Str!"') do set a=%%a
)
start %a%.cmd

点评

还是不行啊,命令行窗口一闪而过,在相应的文件夹里面也没有找到下载成功的批处理。  详情 回复 发表于 2019-5-4 09:27
回复

使用道具 举报

 楼主| 发表于 2019-5-4 09:27:02 | 显示全部楼层
newyun 发表于 2019-5-3 20:22
@echo off & setlocal enabledelayedexpansion
for /f "tokens=1 delims=[]" %%a in ('nbtstat -S^|find / ...

还是不行啊,命令行窗口一闪而过,在相应的文件夹里面也没有找到下载成功的批处理。
回复

使用道具 举报

发表于 2019-5-4 09:30:33 | 显示全部楼层
首先你要确定一个问题,,那就是你的网络连接是不是叫 本地连接  ,然后你要看你pe是否精简了相关的东西,,比如命令中调用了nbtstat
回复

使用道具 举报

发表于 2019-5-4 09:46:13 | 显示全部楼层
或者你就直接for %%i in (*.cmd) do start %%i
回复

使用道具 举报

发表于 2019-5-4 14:11:37 | 显示全部楼层
本帖最后由 yigeren 于 2019-5-4 14:14 编辑


思路1:把pxeautorun.CMD直接放在到PE系统里,省事

思路2:把服务端上的pxeautorun.CMD文件放在自己设置的共享文件夹里,客户机网启后,先自动映射服务端上的共享文件夹,然后再去执行pxeautorun.CMD就行了
映射命令:
net use z: \\服务端IP\共享文件夹 "密码" /user:guest
说明:映射服务端上的共享文件夹在客户端PE系统上为Z盘
回复

使用道具 举报

发表于 2019-5-5 15:24:55 | 显示全部楼层
楼主是要在不同pe执行一个批处理这么简单的事,方法成千上万,可以
注册表里run项添加这个批处理的路径
启动文件夹里加这个批处理的路径
winpeshl.ini里加这个批处理的路径
pecmd.ini里加这个批处理的路径
………………省略一万种方法
我都跟楼主说过了,都进桌面了,运行什么文件都可以
回复

使用道具 举报

发表于 2019-5-6 12:10:43 | 显示全部楼层
本帖最后由 假大空 于 2019-5-6 12:28 编辑

l大的原版里面有用法啊。get命令获取。pe网络加载成功后应该运行了微型tftp。看了下l大pecmd脚本如下:
     exec* &&netok=!ipconfig
     SED &&z=?,IPv4,,%&netok%
     ifex $0=%&z%, TEAM mess 网络没有准备好| exit file
     FILE %windir%\system32\pxeautorun.cmd
     TEAM TEXT   正在从服务端下载脚本……$15|WAIT 100
     exec* -err+ &&jg=!tftp -i %1 get pxeautorun.txt %windir%\system32\pxeautorun.cmd
     SED &&z=?,成功,,%&jg%
     ifex $0=%&z%, mess+icon2+top 获取服务端脚本文件失败
     wait 500
     ifex %windir%\system32\pxeautorun.cmd, exec pxeautorun.cmd %1

点评

这个是所有PE都能用吗?还是只能是部分没有精简的PE可以使用?  详情 回复 发表于 2019-5-6 14:53
回复

使用道具 举报

 楼主| 发表于 2019-5-6 14:52:59 | 显示全部楼层
谢谢大家。我再研究哈。
回复

使用道具 举报

 楼主| 发表于 2019-5-6 14:53:53 | 显示全部楼层
假大空 发表于 2019-5-6 12:10
l大的原版里面有用法啊。get命令获取。pe网络加载成功后应该运行了微型tftp。看了下l大pecmd脚本如下:
   ...

这个是所有PE都能用吗?还是只能是部分没有精简的PE可以使用?
回复

使用道具 举报

发表于 2019-8-2 22:44:28 | 显示全部楼层
楼主研究有进展吗?
回复

使用道具 举报

发表于 2019-8-3 20:03:26 | 显示全部楼层
本帖最后由 as8686886 于 2019-8-3 20:13 编辑

我已经移植到我的PE里了
在PECMD.ini末尾加一条
EXEC %WinDir%\system32\pecmd.exe %WinDir%\system32\pxe.ini
PXE.ini的内容为
_SUB autorun
     REGI $HKLM\SYSTEM\CurrentControlSet\Control\PEBootServerAddr,&&ServerAddr
     REGI $HKCU\Software\TightVNC\Control\ReverseConnectionHistory\0=%&ServerAddr%
     exec =!tftp -i %&ServerAddr% get pxeautorun.txt %windir%\system32\pxeautorun.cmd
     wait 500
     ifex %windir%\system32\pxeautorun.cmd, exec pxeautorun.cmd %&ServerAddr%
     exit file
_END

SERV !IKEEXT
EXEC -hide taskmgr.exe
EXEC =!CMD.EXE /C "DEL /Q /F %windir%\system32\pxeautorun.cmd"
SERV !IKEEXT
exec *drvload %windir%\inf\netrndis.inf %windir%\inf\wceisvista.inf
regi #HKLM\SYSTEM\ControlSet001\Services\IKEEXT\start=0x03
REGI $HKLM\SYSTEM\CurrentControlSet\Control\PEBootType,&&Boottype
kill taskmgr.exe
FIND $Remote=%&Boottype%,call autorun
forx *.*.*.*.cmd,&&bat,1 ,team NAME &&fNam=%&bat% | exec %&bat% %&fNam%
EXIT FILE

UEFI PXE和MBR PXE都可以启动并加载脚本,如果把这段直接加到pecmd.ini里PXE模式下启动有时候不执行这个脚本,试过好多次
PE的system32目录里必须有tftp.exe程序否则脚本执行不下去!
还有httpdisk我也弄进去了
我的用PXE启动的PE
Windows 7 x64-2019-08-03-20-11-27.png
回复

使用道具 举报

发表于 2023-6-7 17:33:22 | 显示全部楼层
as8686886 发表于 2019-8-3 20:03
我已经移植到我的PE里了
在PECMD.ini末尾加一条
EXEC %WinDir%\system32\pecmd.exe %WinDir%\system32\px ...

请问你是如何移植成功httpdisk的 用的是什么版本的系统做的winpe的我用了N个版本的 看网上说用win10_1903行我也试了加vcruntime140dll也试了还是不行

点评

httpdisk需要在bcd开启测试模式。这是作者写的安装方法: Copy the driver (httpdisk.sys) to %systemroot%\system32\drivers\. The drivers in the sys\obj directory are compiled for Windows XP (and all l  详情 回复 发表于 2024-3-10 20:55
回复

使用道具 举报

发表于 2023-6-9 21:19:38 | 显示全部楼层
http 下载如何操作 ftp tftp太慢
回复

使用道具 举报

发表于 2024-3-10 20:55:04 | 显示全部楼层
oviivo 发表于 2023-6-7 17:33
请问你是如何移植成功httpdisk的 用的是什么版本的系统做的winpe的我用了N个版本的 看网上说用win10_1903 ...

httpdisk需要在bcd开启测试模式。这是作者写的安装方法:
Copy the driver (httpdisk.sys) to %systemroot%\system32\drivers\.

The drivers in the sys\obj directory are compiled for Windows XP
(and all later versions of Windows) while the drivers in the sys\Debug
and sys\Release directories are compiled for Windows 10 and testsigned
with a SHA-2 signature.

(chk is the debug version, fre is the normal version,
i386 is for 32-bit systems and amd64 is for 64-bit systems)

Optionally edit httpdisk.reg for automatic or manual start and
number of devices.

Import httpdisk.reg to the Registry.

Reboot. If using an unsigned driver and running on the 64-bit version
of Windows press F8 and select "Disable enforce driver signing".
On later versions of Windows this boot setting can be reached by holding
down shift before clicking restart.

The drivers are testsigned, you can allow Windows to load testsigned drivers
with the command "bcdedit /set testsigning on".

Use the program httpdisk.exe to mount and umount disk or CD/DVD
images.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-3-29 17:09

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表