Re: VBS login script not processing .CMD file
- From: "Richard Mueller [MVP]" <rlmueller-NOSPAM@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 14 Feb 2007 17:17:42 -0600
The error message seems to indicate that snetcfg.exe was not found, so the
current directory when the cmd runs is not what you expect. I would try (for
example):
%0\..\snetcfg.exe -v -u MS_Server
Note that the same syntax was used to run osver and that seemed to work.
--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab web site - http://www.rlmueller.net
--
"Blenvid" <Blenvid@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DE35C729-B086-495D-A48D-96DC1C81F7CE@xxxxxxxxxxxxxxxx
Hello, and thanks for reading my post.as
I work on a Server 2003 Active Directory Integrated domain. Most of the
clients are Windows XP clients, but there are a couple 2000 Pro. clients
well as a couple 2000 Servers and NT servers. This is a rather complexissue
so I'll try and make it as brief as possible.which
Network Security policy dictates that we have to run a certain product
fixes most out of the box vulnerabilities on Windows systems, includingFile
and Print Sharing. Unfortunately, we have a product, which is required,which
needs File and Print Sharing so without the manpower to go to over 800to
systems, I'm looking for an automated way to get it done.
I've found through numerous discussions online that there is no easy way
enable or disable it via GPO, the only way which seems to work for peopleis
with the use of a ?snetcfg.exe? or ?snetcfg_xp.exe? file which was writtenby
a semi-famous programmer, Bill Steward, to drop down to the programming ofthe
the NIC adaptor and change it. Here?s some of the links that are just a
couple of the ones I found mentioning the ?snetcfg.exe? as the solution,
only solution which works. Microsoft articles relating to this are talking?s
about the ?File and Print Sharing? option which is a part of the Windows
Firewall. We have the Windows Firewall disabled so these don?t apply. Here
some links:http://help.lockergnome.com/windows2/File-printer-sharing-group-policy-ftopict183458.html
http://www.experts-exchange.com/Networking/Windows_Networking/Q_20820999.html?qid=20820999
http://internet.cybermesa.com/~bstewart/wast.htmlscript
http://www.tek-tips.com/viewthread.cfm?qid=929271&page=7
I downloaded the files ?snetcfg.exe?, ?snetcfg_xp.exe? and ?osver.exe. I
dropped them in the netlogon folder of our DC and edited the test.vbs
to include the ?FP_set.cmd? file I created with the instructions on one ofexample-------------------------------------
the websites. Here's the VBS code which is to run the CMD file:
--------------------start code example----------------------------------
' ******* Enable File and Print Sharing***************
WshShell.Run ("%LOGONSERVER%\netlogon\FP_set.cmd")
----------------------end code
batch
The code seems to run at first in the CMD file, because it returns the
correct OS in the beginning. However, I later see numerous "snetcfg.exe is
not recognized as an internal or external command, operable program, or
file." Here is the code of the command file:be
----------------------start code example---------------------------------
@ECHO OFF
REM Determine which version of OS is running.
%0\..\OSVER /QUIET /TERMINALS
SET OSVER=%ERRORLEVEL%
IF %OSVER%==6 GOTO :W2K
IF %OSVER%==7 GOTO :XP
:w2K
snetcfg.exe -v -u MS_Server
snetcfg.exe -v -l %system%\inf \netserv.inf -c S -i ms_server
NET STOP BROWSER
NET STOP SERVER
NET START BROWSER
NET START SERVER
goto EOF
:XP
snetcfg_wxp.exe -v -u MS_Server
snetcfg_wxp.exe -v -l %system%\inf \netserv.inf -c S -i MS_Server
NET STOP BROWSER
NET STOP SERVER
NET START BROWSER
NET START SERVER
goto EOF
:EOF
---------------------end code example-----------------------
I have a feeling I've referenced the CMD in the VBscript in an improper
format. But I can't be sure. Any suggestions or corrections of code would
greatly appreciated.
.
- References:
- VBS login script not processing .CMD file
- From: Blenvid
- VBS login script not processing .CMD file
- Prev by Date: Re: Getting Return Code from SQL
- Next by Date: Re: Paging disconnected recordset
- Previous by thread: VBS login script not processing .CMD file
- Next by thread: Re: VBS login script not processing .CMD file
- Index(es):
Relevant Pages
|