1.

Solve : How can I make a vbscript run a .bat file invisibly off a cd??

Answer»

I made a .bat file that disconnects you from the internet, and i also made a vbscript that will make this file run in invisible mode. The problem is when vbscript RUNS automatically from a cd the location of the file changes so it doesnt work.

Heres an example, lets say i burn the .bat file and the vbscript on a cd.
When i make the vbscript i write the location of the .bat in cd drive D.
Now if i put the cd in cd drive E, the vbscript won't run.

Is there anyway to make the vbscript look for the .bat is any drive?
Or make it so the vbscript doesn't display the error when it doesn't find the .bat file?

In a .bat file i can write %CDROM% instead of the cd drive, is there something similar to that in vbscript.Why would you want something like this to run in invisible mode?So you wouldn't see it .........So in other words you want the good people here to help you make something that disconnects people from the internet with out their knowledge.

I maybe wrong here but I think that is a little bit outside of what the forum allows people to help with.Why do people on this forum always make things so difficult and in need of explanation? The people would obviously know they are disconnected from the internet. The cd just installs a FIREWALL onto your computer i thought it would be safe to make it disconnect your from the internet and reconnect you after the installation is over.

I also asked the question on Computerforums.org

The first response wasn't Why do you want this? It was:

This page might help you. You'd have to get the script to find the drive letter first and assign it to a variable, then tell the script to run the batch file from the drive letter contained within that variable.

I know very little about VBScript, so I can't do more than provide you with this.

http://www.msfn.org/board/lofiversio...p/t112548.html
__________________

Thats it and thats good enough for me.Got it:

On Error Resume Next
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "D:\Disconnect.bat" & Chr(34), 0
Set WshShell = Nothing
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "E:\Disconnect.bat" & Chr(34), 0
Set WshShell = Nothing
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "F:\Disconnect.bat" & Chr(34), 0
Set WshShell = Nothing
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "G:\Disconnect.bat" & Chr(34), 0
Set WshShell = Nothing
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "H:\Disconnet.bat" & Chr(34), 0
Set WshShell = NothingOr...


Code: [Select]On Error Resume Next
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run """\Disconnect.bat""", 0
Quote from: shrshr429 on July 08, 2009, 10:07:59 AM

Why do people on this forum always make things so difficult and in need of explanation?

Because the alternative would be to give you crappy advice and potentially cause more problems than fix?

AH yes, the eternal conflict between perceiving (P) personalities and judging (J) personalities.  P personalities prefer to learn, while J personalities prefer to make decisions.  Extreme P's tend to dwell on stuff and forget that there's a problem to fix, while extreme J's tend to want things done RIGHT now and worry about the consequences later.


Discussion

No Comment Found