|
hackate
中级用户
  
积分 228
发帖 125
注册 2008-8-25
状态 离线
|
『楼 主』:
[已结]在开始启动菜单中隐藏运行批处理的怪事
使用 LLM 解释/回答一下
if "%1"=="" start mshta vbscript:CreateObject("WScript.Shell").run("%~nx0 h",0)(window.close)&&exit
此代码是隐藏运行批处理的..我写了个批处理..把此批处理放到开始"启动"里面..
然后电脑一开机就提示脚本错误...说找不到文件...
可是我直接手动运行是可以的啊。真的不知道为什么哪里错了.难道加到启动项里,开机运行的形式哪里不相同了吗?/
还请各位高手帮忙解决...
Last edited by HAT on 2008-12-5 at 13:57 ]
if "%1"=="" start mshta vbscript:CreateObject("WScript.Shell").run("%~nx0 h",0)(window.close)&&exit
This code is for hiding the running of a batch script.. I wrote a batch script.. put this batch script into the "Startup" in the start menu..
Then the computer prompts a script error every time it starts up... saying that the file is not found...
But I can run it manually directly.. really don't know where the mistake is... Could it be that the form of running at startup is different?/
Please help the experts to solve...
Last edited by HAT on 2008-12-5 at 13:57 ]
|
|
2008-12-4 19:50 |
|
|
hackate
中级用户
  
积分 228
发帖 125
注册 2008-8-25
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
怎么没人来看看,郁闷了
Why is there no one coming to take a look? I'm郁闷了.
|
|
2008-12-4 20:25 |
|
|
tireless
银牌会员
    
积分 2025
发帖 1122
注册 2007-9-5
状态 离线
|
|
2008-12-4 20:29 |
|
|
hackate
中级用户
  
积分 228
发帖 125
注册 2008-8-25
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
回TREE兄,之前已经测试过,没有用,一样的错误..
此问题着实让人郁闷啊。
Reply: Back to Brother TREE, I have tested it before, it didn't work, the same error... This problem is really frustrating.
|
|
2008-12-4 20:50 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
这样试试呢?
run("""%~0"" h",0)
How about trying this?
run("""%~0"" h",0)
|
|
2008-12-4 22:49 |
|
|
dato
高级用户
   
积分 916
发帖 377
注册 2004-3-8
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
估计又要用ping进行延时处理
这种情况偶碰到很多的,个人理解为在某某启动时刻不能运行一些命令所以只能用ping进行延时处理直到进入桌面或者某种时刻才能运行.
以前用.cmd运行sc控制服务的批处理可以放置在计算机启动阶段运行.
后来用nsi封装为.exe文件就只能在用户启动阶段运行.
差别一个用cmd.exe运行一个需要用到wscript.exe
It is estimated that ping will be used again for delay processing.
I have encountered this situation many times. Personally, I understand that some commands cannot be run at a certain startup moment, so ping can only be used for delay processing until entering the desktop or a certain moment to be able to run.
Previously, a batch script that used.cmd to run sc to control services could be placed to run at the computer startup stage.
Later, when packaged into an.exe file with nsi, it can only run at the user startup stage. The difference is one runs with cmd.exe and the other needs to use wscript.exe
|

http://dato.ys168.com
google search bot
http://dato.minidns.net/ |
|
2008-12-5 00:00 |
|
|
hackate
中级用户
  
积分 228
发帖 125
注册 2008-8-25
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
回LXMXN哥哥..没用的,这个方法我也测试过.
回楼上的DATO兄,我也是这么认为的,后来我解决了.用如下方式解决...
@echo off
if not exist "%USERPROFILE%\「开始」菜单\程序\启动\hide.vbs" call :add
:loop
.............................
goto :loop
:add
echo Dim Wsh>"%USERPROFILE%\「开始」菜单\程序\启动\hide.vbs"
echo Set Wsh = WScript.CreateObject("WScript.Shell")>>"%USERPROFILE%\「开始」菜单\程序\启动\hide.vbs"
echo WScript.Sleep(0)>>"%USERPROFILE%\「开始」菜单\程序\启动\hide.vbs"
echo Wsh.Run "C:\windows\chuli.bat",false,false>>"%USERPROFILE%\「开始」菜单\程序\启动\hide.vbs"
copy /y "%~nx0" "c:\windows\">nul
start mshta vbscript:CreateObject("WScript.Shell").Run("%~NX0",0)(window.close)&&exit
goto :eof
Last edited by hackate on 2008-12-5 at 13:07 ]
Reply to brother LXMXN.. It's no use, I've tested this method too.
Reply to the above DATO brother, I also thought so, and later I solved it. Solved it in the following way...
@echo off
if not exist "%USERPROFILE%\「Start」 Menu\Programs\Startup\hide.vbs" call :add
:loop
.............................
goto :loop
:add
echo Dim Wsh>"%USERPROFILE%\「Start」 Menu\Programs\Startup\hide.vbs"
echo Set Wsh = WScript.CreateObject("WScript.Shell")>>"%USERPROFILE%\「Start」 Menu\Programs\Startup\hide.vbs"
echo WScript.Sleep(0)>>"%USERPROFILE%\「Start」 Menu\Programs\Startup\hide.vbs"
echo Wsh.Run "C:\windows\chuli.bat",false,false>>"%USERPROFILE%\「Start」 Menu\Programs\Startup\hide.vbs"
copy /y "%~nx0" "c:\windows\">nul
start mshta vbscript:CreateObject("WScript.Shell").Run("%~NX0",0)(window.close)&&exit
goto :eof
Last edited by hackate on 2008-12-5 at 13:07 ]
此帖被 +4 点积分 点击查看详情 评分人:【 HAT 】 | 分数: +2 | 时间:2008-12-5 13:55 | 评分人:【 ysc 】 | 分数: +2 | 时间:2009-11-21 09:29 |
|
|
|
2008-12-5 13:05 |
|
|
5551551
初级用户
 
积分 37
发帖 39
注册 2007-12-7
状态 离线
|
|
2008-12-5 19:33 |
|
|
fjdragon
新手上路

积分 3
发帖 2
注册 2006-11-2
状态 离线
|
|
2009-2-11 11:05 |
|
|
netbenton
银牌会员
     批处理编程迷
积分 1916
发帖 752
注册 2008-12-28 来自 广西
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
其实应该直接把:
start mshta vbscript:CreateObject("WScript.Shell").Run("%~NX0",0)(window.close)&&exit
中的Run("%~NX0",0) 改成:
Run("%~f0",0) 或者Run("%~dpnx0",0)
就可以了吧
Actually, you should directly change:
start mshta vbscript:CreateObject("WScript.Shell").Run("%~NX0",0)(window.close)&&exit
The Run("%~NX0",0) in it to:
Run("%~f0",0) or Run("%~dpnx0",0)
Is that okay?
|

精简
=> 个人 网志  |
|
2009-2-11 12:59 |
|
|
ddd010
新手上路

积分 15
发帖 12
注册 2008-12-1
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
学习。其实DATO的说法很实用。
Learning. In fact, DATO's statement is very practical.
|
|
2009-11-19 18:25 |
|