Re: How do I...

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Wesley Vogel (123WVogel955_at_comcast.net)
Date: 11/26/04


Date: Fri, 26 Nov 2004 06:46:56 -0700

Bill,

I use vbs scripts all the time. Unfortunately, others have written them.

Set oShell = CreateObject("WScript.Shell")
oShell.Run "%SystemRoot%\System32\rasdial.exe /disconnect", 0

Won't do much on my machine, the phone modem has been in the computer junk
box out in the garage for two years.

It's extremely difficult to advise someone on something that I don't know
how to do. ;-) Torgeir ought to get you straightened out. :-)

You'd be surprised how much MS-DOS programming applies in XP. I've been
dusting off my "Running MS-DOS Version 6.22" book quite often lately.

Most of the batch files that I use are just simple, save the typing variety.
I have all kinds of samples of more elaborate batch files, but I haven't
found the need to actually use any.

-- 
Hope this helps.  Let us know.
Wes
In news:so9pd.3136$NU3.2570@newsread1.news.pas.earthlink.net,
Bill <stanton@jps.net> hunted and pecked:
> Wes,
> As you saw in my post to Torgeir, I have some amount of
> experience with VBA. The VBS language is probably a
> subset of what is in VBA, but in any event there seems to
> be hope that I can run Rasdial "quietly" as desired.
>
> Since my post to Torgeir, I did a little homework and
> searches to better understand where VBS fits into the
> scheme of things. I didn't realize it had somewhat evolved
> from what used to be referred to as "Bat Language"...
> Basic back in the pure DOS days. I'll continue my
> search as I await Torgeir's reply post.
>
> Keep your eye on this thread if you'd like and I'll post the
> VBS code plus some explanations of how it works and how
> to deploy. I'll try to deploy both from the Registry and the
> current user startup.
>
> Bill
>
>
> "Wesley Vogel" <123WVogel955@comcast.net> wrote in message
> news:%23XuD9Eo0EHA.2156@TK2MSFTNGP10.phx.gbl...
>> Bill,
>>
>> I was going to suggest a .vbs script, but I know nothing about
>> writing them.
>>
>> --
>> Hope this helps.  Let us know.
>> Wes
>>
>> In news:cqRod.3246$uV6.64@newsread3.news.pas.earthlink.net,
>> Bill <stanton@jps.net> hunted and pecked:
>>> Wes,
>>> I initiated the BAT file from the Registry without any
>>> trouble. I also experimented with the "m" and "q" switches
>>> trying to get the "DOS CMD.EXE" window to either run
>>> minimized or not display at all, the latter being my preference.
>>> Since the switches are applied to Rasdial, Rasdial fails when
>>> any unsupported switches are attempted.
>>>
>>> It would be really cool if there was a "hook" of some sort
>>> wherein a user could automatically launch network
>>> connections via the same path that the desktop shortcuts
>>> take. Rasdial obviously uses a different path that involves
>>> CMD.EXE. The "Target Type" in the shortcut properties
>>> is a strange looking string that gives no clue as to how it's
>>> used.
>>>
>>> Unless you have any additional ideas, I guess I'll have to
>>> either accept the DOS window display or give up the
>>> whole idea.
>>>
>>> If something should pop into your creative thinking after
>>> we abandon this thread, send a note to stanton@jps.net.
>>>
>>> Thanks again for all your help. I learned some more about
>>> the subtleties of XP amongst other items of interest.
>>>
>>> Bill
>>>
>>>
>>> "Wesley Vogel" <123WVogel955@comcast.net> wrote in message
>>> news:O8X3kkb0EHA.1152@TK2MSFTNGP14.phx.gbl...
>>>> Bill,
>>>>
>>>> Any of these three startup locations should be fine.
>>>>
>>>> C:\Documents and Settings\All Users\Start
>>>> Menu\Programs\Startup\shortcut to
>>>> Dial.bat
>>>>
>>>> C:\Documents and Settings\Your Name Here\Start
>>>> Menu\Programs\Startup\shortcut to Dial.bat
>>>>
>>>> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
>>>> "dial"="C:\Dial.bat"
>>>>
>>>> I run my startup batch files from the registry entry above.  I
>>>> don't even mess with AUTOEXEC.NT. Unless you're actually running a
>>>> DOS program no need
>>>> to mess with any of the old DOS type items.
>>>>
>>>> /q is used quite often for quiet operation, but I don't see where
>>>> that applies to rasdial.  Maybe /m for minimzed.
>>>>
>>>> For more help...
>>>>
>>>> Command-line reference A-Z
>>>>
>>>> Start | Run | Copy and paste the following line:
>>>>
>>>> %windir%\hh.exe ms-its:c:\Windows\Help\ntcmds.chm::/ntcmds.htm
>>>>
>>>> Click OK
>>>> --
>>>> Hope this helps.  Let us know.
>>>> Wes
>>>>
>>>> In news:ibxod.1599$NU3.794@newsread1.news.pas.earthlink.net,
>>>> Bill <stanton@jps.net> hunted and pecked:
>>>>> Wes,
>>>>> Your suggestions, descriptions and URL's were very
>>>>> helpful and informative.
>>>>>
>>>>> I had entirely the wrong parameters in the Rasdial
>>>>> command. As soon as I got that right, my test BAT
>>>>> file that contained the command worked. My only
>>>>> problem is that when the BAT file is run the DOS
>>>>> window is displayed, which of course displays my
>>>>> password in plain sight. Anyway to run that BAT
>>>>> file "quietly"?
>>>>>
>>>>> I thought I understood that inserting the Rasdial command
>>>>> in AUTOEXEC.NT would cause that command to be
>>>>> executed with the system started. However, putting the
>>>>> command there didn't seem to do anything, certainly didn't
>>>>> initiate a connection. I was only able to effect a launch when
>>>>> I copied the BAT file into my Startup folder. What part of
>>>>> your lesson on AUTOEXEC.NT didn't I understand.
>>>>> The MS sites described the use of Rasdial and how to code
>>>>> it, but I failed to see where the command should be placed.
>>>>>
>>>>> Thanks,
>>>>> Bill
>>>>>
>>>>>
>>>>> "Wesley Vogel" <123WVogel955@comcast.net> wrote in message
>>>>> news:OASBwAP0EHA.3588@TK2MSFTNGP14.phx.gbl...
>>>>>> Maybe these links will help...  Speaking of help, these are just
>>>>>> on-line links of items that are in Help and Support on your
>>>>>> machine.
>>>>>>
>>>>>> Automating a network connection
>>>>>>
>>>>
>>
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/using_automate_conn.mspx
>>>>>>
>>>>>> Configuring dial-up options
>>>>>>
>>>>
>>
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/dial_connect_concept.mspx
>>>>>>
>>>>>> To configure autodial
>>>>>>
>>>>
>>
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/howto_autodial.mspx
>>>>>>
>>>>>> Using rasdial
>>>>>>
>>>>
>>
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ras_rasdial_overview.mspx
>>>>>>
>>>>>> Rasdial
>>>>>>
>>>>
>>
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/rasdial.mspx
>>>>>>
>>>>>> First, Windows XP is really Windows NT 5.1.  XP got it's name for
>>>>>> some marketing reason.  Most NT references will apply to XP.
>>>>>>
>>>>>> My AUTOEXEC.BAT, CONFIG.SYS, IO.SYS & MSDOS.SYS are empty.
>>>>>>
>>>>>> From various sources...
>>>>>>
>>>>>> Windows XP uses Config.nt and Autoexec.nt, not Config.sys or
>>>>>> Autoexec.bat.
>>>>>>
>>>>>> If you have a Config.sys or Autoexec.bat file XP will (mostly)
>>>>>> ignore them.
>>>>>> Nothing in Config.sys will have any effect. Any line in
>>>>>> Autoexec.bat that launches a program or changes a directory will
>>>>>> be ignored; the only lines in
>>>>>> Autoexec.bat that Windows XP will read are the lines that begin
>>>>>> SET or PATH.
>>>>>> If ParseAutoexec is set to 1.
>>>>>>
>>>>>> In order to launch programs or change settings for DOS programs
>>>>>> under Windows XP, you must modify two files named Config.nt and
>>>>>> Autoexec.nt, typically found in the C:\Windows\System32
>>>>>> directory.
>>>>>>
>>>>>> Config.nt is used for the same kind of tasks formerly performed
>>>>>> by Config.sys (loading device drivers, etc.). Autoexec.nt is
>>>>>> used for the same
>>>>>> kind of tasks formerly performed by Autoexec.bat (launching
>>>>>> memory-resident
>>>>>> programs, etc.) Only old-style 16-bit DOS programs can be run
>>>>>> from Autoexec.nt. You cannot use Autoexec.nt to run 32-bit
>>>>>> Windows XP text-mode programs like MODE or SUBST; these programs
>>>>>> may be run in an ordinary batch
>>>>>>
>>>>>> file, but not in Autoexec.nt.
>>>>>>
>>>>>> The following tells XP (NT) if it should include variables in the
>>>>>> Autoexec.bat...
>>>>>>
>>>>>> Key:[HKEY_CURRENT_USER\Software\Microsoft\Windows
>>>>>> NT\CurrentVersion\Winlogon]
>>>>>> Value Name: ParseAutoexec
>>>>>> Data Type: REG_SZ
>>>>>> Data:(0 = disabled, 1 = enabled)
>>>>>>
>>>>>> To add or change environment variables with Windows XP:
>>>>>> 1. Right click on My Computer
>>>>>> 2. Select Properties
>>>>>> 3. Click on the Advanced tab
>>>>>> 4. Click on the Environment Variables button
>>>>>> 5. From here you can change it for the system or just the current
>>>>>> user. ---
>>>>>>
>>>>>> From my AUTOEXEC.NT...
>>>>>> AUTOEXEC.BAT is not used to initialize the MS-DOS environment.
>>>>>> AUTOEXEC.NT is used to initialize the MS-DOS environment unless a
>>>>>> different startup file is specified in an application's PIF.
>>>>>> Everything is REM'd out except...
>>>>>> lh %SystemRoot%\system32\mscdexnt.exe
>>>>>> lh %SystemRoot%\system32\redir
>>>>>> lh %SystemRoot%\system32\dosx
>>>>>>
>>>>>> From my CONFIG.NT...
>>>>>> CONFIG.SYS is not used to initialize the MS-DOS environment.
>>>>>> CONFIG.NT is used to initialize the MS-DOS environment unless a
>>>>>> different startup file is specified in an application's PIF.
>>>>>> Everything is REM'd out except...
>>>>>> dos=high, umb
>>>>>> device=%SystemRoot%\system32\himem.sys
>>>>>> files=40
>>>>>> ---
>>>>>>
>>>>>> lh %SystemRoot%\system32\mscdexnt.exe
>>>>>> loads into the UMBs (Upper Memory Blocks) the NT CD reader
>>>>>> equivalent to the
>>>>>> well known mscdex for DOS
>>>>>>
>>>>>> lh %SystemRoot%\system32\redir
>>>>>> loads into the UMBs the LAN redirector to enable the mapping of
>>>>>> remote devices
>>>>>>
>>>>>> lh %SystemRoot%\system32\dosx
>>>>>> loads into the UMBs the protected mode DOS extender to access the
>>>>>> memory above the first megabyte
>>>>>>
>>>>>> By the way the use of lh requires the presence of the following
>>>>>> lines in Config.NT
>>>>>>
>>>>>> EMM=Ram
>>>>>> DOS=High,Umb
>>>>>> -----
>>>>>>
>>>>>> AUTOEXEC.NT & CONFIG.NT are both located here >>>
>>>>>> C:\WINDOWS\system32
>>>>>> and
>>>>>> C:\WINDOWS\repair
>>>>>>
>>>>>> AUTOEXEC.BAT, CONFIG.SYS, IO.SYS & MSDOS.SYS are all located here
>>>>>>>>> C:\
>>>>>> ----
>>>>>>
>>>>>> Don't let the titles fool you.  Lots of info here >>>
>>>>>>
>>>>>> Virtual Device Drivers for MS-DOS Applications or Special
>>>>>> Hardware
>>>>>>
>>>>
>>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/other/hh/other/vdd_a83ccf36-0fcb-41d0-a5eb-ff5e4bbf8106.xml.asp
>>>>>>
>>>>>> Troubleshooting MS-DOS-based programs in Windows XP
>>>>>> http://support.microsoft.com/default.aspx?scid=kb;en-us;314106
>>>>>>
>>>>>> How To Manage Environment Variables in Windows XP
>>>>>> http://support.microsoft.com/default.aspx?scid=kb;en-us;310519
>>>>>>
>>>>>> Description of the Microsoft Windows registry
>>>>>> http://support.microsoft.com/default.aspx?scid=kb;en-us;256986
>>>>>>
>>>>>> --
>>>>>> Hope this helps.  Let us know.
>>>>>> Wes
>>>>>>
>>>>>> In news:GKqod.2264$uV6.1635@newsread3.news.pas.earthlink.net,
>>>>>> Bill <stanton@jps.net> hunted and pecked:
>>>>>>> Wes,
>>>>>>> SIGH! Now I can't get either of the two bat files shown
>>>>>>> below to work. That being the case, it obviously serves
>>>>>>> no purpose to try different methods of invocation.
>>>>>>>
>>>>>>> Bat file #1:
>>>>>>> Rasdial <earthlink>  <Bill Stanton> <mypassword> [hit enter]
>>>>>>>
>>>>>>> Bat file #2
>>>>>>> Start C:\dial.lnk     (Where "dial" is a shortcut to the
>>>>>>> connection)
>>>>>>>
>>>>>>> Any ideas?
>>>>>>>
>>>>>>> By-the-way, I assume that the old AUTOEXEC.BAT no longer
>>>>>>> gets executed in the newer XP environments? Odd that it was
>>>>>>> still created when XP was installed on a new machine.
>>>>>>>
>>>>>>> Bill
>>>>>>>
>>>>>>>
>>>>>>> "Wesley Vogel" <123WVogel955@comcast.net> wrote in message
>>>>>>> news:%23SgaviL0EHA.2540@TK2MSFTNGP09.phx.gbl...
>>>>>>>> My first question is.  Does the Dial.bat batch file work when
>>>>>>>> running it?
>>>>>>>>
>>>>>>>> 2)
>>>>>>>> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
>>>>>>>> "dial"="C:\\Dial.bat"  (Where Dial.bat contained a DOS Start
>>>>>>>> command)
>>>>>>>>
>>>>>>>> If your Dial.bat actually works and its location is
>>>>>>>> C:\Dial.bat...
>>>>>>>>
>>>>>>>> Change C:\\Dial.bat    to     C:\Dial.bat
>>>>>>>>
>>>>>>>> These should also work, providing Dial.bat actually works...
>>>>>>>>
>>>>>>>> C:\Documents and Settings\All Users\Start
>>>>>>>> Menu\Programs\Startup\shortcut to
>>>>>>>> Dial.bat
>>>>>>>>
>>>>>>>> C:\Documents and Settings\Your Name Here\Start
>>>>>>>> Menu\Programs\Startup\shortcut to Dial.bat
>>>>>>>>
>>>>>>>> Maybe you could post the contents of Dial.bat.
>>>>>>>>
>>>>>>>> --
>>>>>>>> Hope this helps.  Let us know.
>>>>>>>> Wes
>>>>>>>>
>>>>>>>> In news:gDcod.904$NU3.642@newsread1.news.pas.earthlink.net,
>>>>>>>> Bill <stanton@jps.net> hunted and pecked:
>>>>>>>>> I've been trying to find a way to automatically launch
>>>>>>>>> my dial-up connection as part of the boot process.
>>>>>>>>>
>>>>>>>>> I don't want it to be a by-product of starting IE or OE.
>>>>>>>>> Rather, have the connections shortcut executed like any
>>>>>>>>> other application in Startup.
>>>>>>>>>
>>>>>>>>> I tried:
>>>>>>>>> 1) Putting the dial-up shortcut in Startup
>>>>>>>>>
>>>>>>>>> 2)
>>>>>>>>> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
>>>>>>>>> "dial"="C:\\Dial.bat"  (Where Dial.bat contained a DOS
>>>>>>>>> Start command)
>>>>>>>>>
>>>>>>>>> 3) Same as 2 above except inserting the dial-up shortcut
>>>>>>>>> name.
>>>>>>>>>
>>>>>>>>> 4) Putting the dial-up shortcut as a Scheduled Task to
>>>>>>>>> be executed "At System Startup".
>>>>>>>>>
>>>>>>>>> When I examine the properties of the shortcut, I find the
>>>>>>>>> "Target Location" as "Network Connections" and a string
>>>>>>>>> that resembles a registry value as the "Target Type".
>>>>>>>>>
>>>>>>>>> Any suggestions or education about launching "Network
>>>>>>>>> Connections"?
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Bill

Quantcast