Page 1 of 1 1
Topic Options
#117139 - 2004-04-01 01:46 AM COMSPEC Question
ktodi Offline
Getting the hang of it

Registered: 2002-03-29
Posts: 60
I run the following line of code in a script and it always reports back to kixtart after it runs "The command completed succesfully". Is there a way for to add an @Echo off or somethihng to keep this message from popping up in my kixtart script?

SHELL '%ComSpec% /c net localGroup Administrators "CORP\Desktop Admins" /Add'

Top
#117140 - 2004-04-01 02:06 AM Re: COMSPEC Question
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Sure thing, try this:

SHELL '%ComSpec% /c net localGroup Administrators "CORP\Desktop Admins" /Add >NUL 2>NUL'

Top
#117141 - 2004-04-01 02:47 AM Re: COMSPEC Question
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
There is also a swell FAQ in the FAQ forum entitled "All you ever wanted to know about Shell" (or something like that). Check it out!
Top
#117142 - 2004-04-01 07:18 PM Re: COMSPEC Question
ktodi Offline
Getting the hang of it

Registered: 2002-03-29
Posts: 60
I searched the FAQ section for SHELL and that did not come up. Could you possible supply a link or a little more direction as to where to look/search
Top
#117143 - 2004-04-01 07:54 PM Re: COMSPEC Question
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Sure... Not quite everything you wanted to know about RUN and SHELL

About the search, its possible you didn't change the Date Range or some other search property to get the correct results. It trips people up all the time.

Top
#117144 - 2004-04-01 08:11 PM Re: COMSPEC Question
ktodi Offline
Getting the hang of it

Registered: 2002-03-29
Posts: 60
I adjusted the date and found it. Thanks.
Top
#117145 - 2004-04-01 09:03 PM Re: COMSPEC Question
ktodi Offline
Getting the hang of it

Registered: 2002-03-29
Posts: 60
Why do I nned to use >NUL 2>NUL what about 1>NUL. I do not understand the idea of redirecting to an output file when one does not exist.
Top
#117146 - 2004-04-01 11:36 PM Re: COMSPEC Question
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Sorry, just a habit I have. I always redirect stdout (standard console output) to NUL (which is not a file, but simply a NUL device aka "the bit bucket") so that any console output from the "program" is hidden. I also redirect stderr (standard error or 2) to the NUL device as well. Programs can write their error messages to this this device (if they choose) and that just covers all the "output" bases. Handle 1 is stdin (standard input) and if the program runs silently, usually doesn't need to be redirected for these purposes.
Top
#117147 - 2004-04-02 01:53 AM Re: COMSPEC Question
ktodi Offline
Getting the hang of it

Registered: 2002-03-29
Posts: 60
Thanks for everyones help.
Top
#117148 - 2004-04-02 02:14 AM Re: COMSPEC Question
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Here are a couple of links for further information.

http://www.robvanderwoude.com/redirection.html

http://support.microsoft.com/default.aspx?scid=kb;EN-US;264824

Top
#117149 - 2004-04-02 05:35 PM Re: COMSPEC Question - Help On Line Expression
JeremyP Offline
Fresh Scripter

Registered: 2001-11-06
Posts: 5
Loc: USA
Using the SHELL Command, I am having serious trouble in getting this "Command Line" to work from within my script,
A simple MENU type script asking for particular information then sends the info to the command line.

It creates a LOOP process at the command prompt, and the Token is added to from the information in the '(workstations.txt)' file until it reaches the end of the file. It calls the particular program to RUN each time it finished the previous item in the file. This works PERFECTLY on the command line, but I NEED to get to run from an option on a menu style script I am writing. I either get:

"Not recognized internal/file error" or It does nothing.

*** ACTUAL COMMAND LINE USAGE ***

for /F "tokens=1" %i in (workstations.txt) do call vnc7 %i /user username password /log /ultra


**********************************

ANY Help would be greatly appreciated, This Site and Kixtart is the BEST application I use in my Organization for LOCKING down my Computers!

TIA!

Jeremy Peeler

Top
#117150 - 2004-04-02 06:00 PM Re: COMSPEC Question - Help On Line Expression
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
See the RUN/SHELL FAQ in the FAQ Forum.
_________________________
There are two types of vessels, submarines and targets.

Top
#117151 - 2004-04-02 11:29 PM Re: COMSPEC Question - Help On Line Expression
JeremyP Offline
Fresh Scripter

Registered: 2001-11-06
Posts: 5
Loc: USA
I have looked and searched, but have had NO luck in getting that line to work with either using the CHR(34), Triple Quotes, anything I can think of.. The Shell Command Line is in the above post.

This is the results I get from this code:
Code giving the error below:

Shell $CMD + "c:\fastpush\for /F " + "tokens=1" + " %i in ($WSListing) do call vnc7 %i /user $AdminUser $AdminPW /log /ultra"

ERROR MESSAGE:
'c:\fastpush\for' is no
t recognized as an internal or external command,
operable program or batch file.

This is an Advanced CMD Command "for" in the CMD Compspec. It runs a Batch file as well. The "TOKENS=1" Must be in Quotes inside the command line as well, while the other instructions are VARs from Kixtart and command line switches.

I have gone and read the FAQs, but I am sure I am not doing something right. Any help would be greatly appreciated.

Top
#117152 - 2004-04-02 11:35 PM Re: COMSPEC Question - Help On Line Expression
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
So, have you tried adding the "%COMSPEC%" command interpreter into the SHELL statement, e.g.
Code:

SHELL '%COMSPEC% /C ...'

_________________________
There are two types of vessels, submarines and targets.

Top
#117153 - 2004-04-03 06:41 PM Re: COMSPEC Question - Help On Line Expression
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
JeromyP,
Why are you hijaaking KTODI's topic? You should start your own.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#117154 - 2004-04-06 03:47 AM Re: COMSPEC Question - Help On Line Expression
JeremyP Offline
Fresh Scripter

Registered: 2001-11-06
Posts: 5
Loc: USA
Well excuse me for "Hijaking" someone's topic.
That was NOT my intension. It has ALL to do with the
COMSPEC topic, and I was needing some help. I guess I was wrong to ask the best place for answers for "KixTart", etc.
Please Accept my apology and I will not bother anyone with my efforts on trying to finish a project for my organization.

PLease delete my repsonses if needed, so I will not be in "Violation" or anything, as it was not my intension.

Thank You.

Top
#117155 - 2004-04-06 04:43 PM Re: COMSPEC Question - Help On Line Expression
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
JeremyP, please repost your repost the content of your post as a new thread in the Starter's Forum. You caused no great problem but adding to the end of someone else's thread does cause confusion and possibly a lot of email to the originator of the thread if they enable email notification for any responses to the thread. Starting your own thread would assist in getting the proper answerd to your specific question/problem.

_________________________
Home page: http://www.kixhelp.com/hb/

Top
#117156 - 2004-04-09 02:57 AM Re: COMSPEC Question - Help On Line Expression
JeremyP Offline
Fresh Scripter

Registered: 2001-11-06
Posts: 5
Loc: USA
Thank You Howard. I appreciate your repsonse. I in no way meant to "Hijak" anyone's thread, as it was put. I will try to repost in another thread.

JeremyP

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 369 anonymous users online.
Newest Members
rrosell, PatrickPinto, Raoul, Timothy, Jojo67
17877 Registered Users

Generated in 0.069 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org