Home All Groups Group Topic Archive Search About
Author
22 Jan 2009 5:35 PM
Linn Kubler
Hi,

I have a boot floppy for booting my computer to connect to the network so I
can run Ghost and image my machine.  I wrote a little batch file called
logoff.bat for loging off the network when I'm finished.

Logoff.bat contains:
@net stop

When it runs it prompts me for three different responses:
Stopping the NETBEUI service also stops these services:
REQUESTER
Do you want to continue this operation? (Y/N) [Y]:
You are currently logged on as Me.
Do you want to log off? (Y/N) [N]:
Continuing will cancel these connections:
G: \\myserver\myshare
Do you want to continue this operation? (Y/N) [N]:

I answer Y to all three of these and it logs me out.

Question is, is there a way to pass these key strokes through so I don't
have to hit them?  I know, just being lazy.  But I would like to do this,
will save me some time.

I tried:
a:\logoff Y Y Y
a:\logoff < logoff.txt

Where logoff.txt contains:
Y
Y
Y

Neither worked.  Any other suggestions?

Thanks in advance,
Linn

Author
22 Jan 2009 5:55 PM
Al Dunbar
Show quote Hide quote
"Linn Kubler" <lkub***@chartwellwisc2.com> wrote in message
news:OudKLfLfJHA.3668@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> I have a boot floppy for booting my computer to connect to the network so
> I can run Ghost and image my machine.  I wrote a little batch file called
> logoff.bat for loging off the network when I'm finished.
>
> Logoff.bat contains:
> @net stop
>
> When it runs it prompts me for three different responses:
> Stopping the NETBEUI service also stops these services:
> REQUESTER
> Do you want to continue this operation? (Y/N) [Y]:
> You are currently logged on as Me.
> Do you want to log off? (Y/N) [N]:
> Continuing will cancel these connections:
> G: \\myserver\myshare
> Do you want to continue this operation? (Y/N) [N]:
>
> I answer Y to all three of these and it logs me out.
>
> Question is, is there a way to pass these key strokes through so I don't
> have to hit them?  I know, just being lazy.  But I would like to do this,
> will save me some time.
>
> I tried:
> a:\logoff Y Y Y
> a:\logoff < logoff.txt
>
> Where logoff.txt contains:
> Y
> Y
> Y
>
> Neither worked.  Any other suggestions?

the NET command does not seem to accept redirected input, but looks to the
actual console. You could try running your batch file as a scheduled task to
see if NET will assume what you want. Most likely, however, I'd expect it to
just hang.

Alternately, you could script the actions you want performed, and write your
script to interact in whatever way makes sense.

What is it that you want to have happen after the logoff? If you are going
to reboot anyway, you could simply modify your .bat file to execute one of
the availalble "reboot" utilities.

/Al
Author
22 Jan 2009 5:55 PM
Al Dunbar
Show quote Hide quote
"Linn Kubler" <lkub***@chartwellwisc2.com> wrote in message
news:OudKLfLfJHA.3668@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> I have a boot floppy for booting my computer to connect to the network so
> I can run Ghost and image my machine.  I wrote a little batch file called
> logoff.bat for loging off the network when I'm finished.
>
> Logoff.bat contains:
> @net stop
>
> When it runs it prompts me for three different responses:
> Stopping the NETBEUI service also stops these services:
> REQUESTER
> Do you want to continue this operation? (Y/N) [Y]:
> You are currently logged on as Me.
> Do you want to log off? (Y/N) [N]:
> Continuing will cancel these connections:
> G: \\myserver\myshare
> Do you want to continue this operation? (Y/N) [N]:
>
> I answer Y to all three of these and it logs me out.
>
> Question is, is there a way to pass these key strokes through so I don't
> have to hit them?  I know, just being lazy.  But I would like to do this,
> will save me some time.
>
> I tried:
> a:\logoff Y Y Y
> a:\logoff < logoff.txt
>
> Where logoff.txt contains:
> Y
> Y
> Y
>
> Neither worked.  Any other suggestions?

the NET command does not seem to accept redirected input, but looks to the
actual console. You could try running your batch file as a scheduled task to
see if NET will assume what you want. Most likely, however, I'd expect it to
just hang.

Alternately, you could script the actions you want performed, and write your
script to interact in whatever way makes sense.

What is it that you want to have happen after the logoff? If you are going
to reboot anyway, you could simply modify your .bat file to execute one of
the availalble "reboot" utilities.

/Al
Author
22 Jan 2009 6:12 PM
Linn Kubler
Show quote Hide quote
"Al Dunbar" <aland***@hotmail.com> wrote in message
news:em1ByqLfJHA.3904@TK2MSFTNGP02.phx.gbl...
>
> "Linn Kubler" <lkub***@chartwellwisc2.com> wrote in message
> news:OudKLfLfJHA.3668@TK2MSFTNGP03.phx.gbl...
>> Hi,
>>
>> I have a boot floppy for booting my computer to connect to the network so
>> I can run Ghost and image my machine.  I wrote a little batch file called
>> logoff.bat for loging off the network when I'm finished.
>>
>> Logoff.bat contains:
>> @net stop
>>
>> When it runs it prompts me for three different responses:
>> Stopping the NETBEUI service also stops these services:
>> REQUESTER
>> Do you want to continue this operation? (Y/N) [Y]:
>> You are currently logged on as Me.
>> Do you want to log off? (Y/N) [N]:
>> Continuing will cancel these connections:
>> G: \\myserver\myshare
>> Do you want to continue this operation? (Y/N) [N]:
>>
>> I answer Y to all three of these and it logs me out.
>>
>> Question is, is there a way to pass these key strokes through so I don't
>> have to hit them?  I know, just being lazy.  But I would like to do this,
>> will save me some time.
>>
>> I tried:
>> a:\logoff Y Y Y
>> a:\logoff < logoff.txt
>>
>> Where logoff.txt contains:
>> Y
>> Y
>> Y
>>
>> Neither worked.  Any other suggestions?
>
> the NET command does not seem to accept redirected input, but looks to the
> actual console. You could try running your batch file as a scheduled task
> to see if NET will assume what you want. Most likely, however, I'd expect
> it to just hang.
>
> Alternately, you could script the actions you want performed, and write
> your script to interact in whatever way makes sense.
>
> What is it that you want to have happen after the logoff? If you are going
> to reboot anyway, you could simply modify your .bat file to execute one of
> the availalble "reboot" utilities.
>
> /Al
>
Yeah, that's what I suspected you'd say, that NET doesn't accept input like
this.  I always prefer to logout of a system once I have logged in, just
seems the proper way to interact with systems.  It's not that big of a deal
and I don't actually use this more than a few times a year, just thought it
would be nice to not to have to be bothered by it.

Thanks and thanks for responding so quickly,
Linn
Author
22 Jan 2009 11:49 PM
Al Dunbar
"Linn Kubler" <lkub***@chartwellwisc2.com> wrote in message
news:uKRwO0LfJHA.1172@TK2MSFTNGP05.phx.gbl...
>
> "Al Dunbar" <aland***@hotmail.com> wrote in message
> news:em1ByqLfJHA.3904@TK2MSFTNGP02.phx.gbl...
>>
>> "Linn Kubler" <lkub***@chartwellwisc2.com> wrote in message
>> news:OudKLfLfJHA.3668@TK2MSFTNGP03.phx.gbl...

<snip>

>> What is it that you want to have happen after the logoff? If you are
>> going to reboot anyway, you could simply modify your .bat file to execute
>> one of the availalble "reboot" utilities.
>>
>> /Al
>>
> Yeah, that's what I suspected you'd say, that NET doesn't accept input
> like this.  I always prefer to logout of a system once I have logged in,
> just seems the proper way to interact with systems.  It's not that big of
> a deal and I don't actually use this more than a few times a year, just
> thought it would be nice to not to have to be bothered by it.

A few issues...

- First is that I expect that most of the shutdown/reboot utilities
effectively do an implicit logout.

- Second is that if you have logged in with a boot disk in order to re-image
your computer, you are not really logged in in the same way that you are
when you logon to your domain.

If you are manually logging out from this session, the new image is not yet
activated. If you have booted from a floppy, the only sense in which you are
"logged in" is that you have established connections with network resources
such as file shares. From that point of view, I suspect you are the only
entity involved that sees a difference between logging out and simply
terminating share connections. I'm pretty sure it's all the same to the
servers and your network. And the instance of the O/S installed on the
workstation is a non-issue, as it has not been booted.

Or perhaps your environment is radically different from mine.

/Al
Author
22 Jan 2009 6:32 PM
Pegasus (MVP)
Show quote Hide quote
"Linn Kubler" <lkub***@chartwellwisc2.com> wrote in message
news:OudKLfLfJHA.3668@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> I have a boot floppy for booting my computer to connect to the network so
> I can run Ghost and image my machine.  I wrote a little batch file called
> logoff.bat for loging off the network when I'm finished.
>
> Logoff.bat contains:
> @net stop
>
> When it runs it prompts me for three different responses:
> Stopping the NETBEUI service also stops these services:
> REQUESTER
> Do you want to continue this operation? (Y/N) [Y]:
> You are currently logged on as Me.
> Do you want to log off? (Y/N) [N]:
> Continuing will cancel these connections:
> G: \\myserver\myshare
> Do you want to continue this operation? (Y/N) [N]:
>
> I answer Y to all three of these and it logs me out.
>
> Question is, is there a way to pass these key strokes through so I don't
> have to hit them?  I know, just being lazy.  But I would like to do this,
> will save me some time.
>
> I tried:
> a:\logoff Y Y Y
> a:\logoff < logoff.txt
>
> Where logoff.txt contains:
> Y
> Y
> Y
>
> Neither worked.  Any other suggestions?
>
> Thanks in advance,
> Linn

What operating system do you have on your boot floppy? DOS 7?
Author
23 Jan 2009 2:54 PM
Linn Kubler
Show quote Hide quote
"Pegasus (MVP)" <I.***@fly.com.oz> wrote in message
news:egzJ7%23LfJHA.3668@TK2MSFTNGP03.phx.gbl...
>
> "Linn Kubler" <lkub***@chartwellwisc2.com> wrote in message
> news:OudKLfLfJHA.3668@TK2MSFTNGP03.phx.gbl...
>> Hi,
>>
>> I have a boot floppy for booting my computer to connect to the network so
>> I can run Ghost and image my machine.  I wrote a little batch file called
>> logoff.bat for loging off the network when I'm finished.
>>
>> Logoff.bat contains:
>> @net stop
>>
>> When it runs it prompts me for three different responses:
>> Stopping the NETBEUI service also stops these services:
>> REQUESTER
>> Do you want to continue this operation? (Y/N) [Y]:
>> You are currently logged on as Me.
>> Do you want to log off? (Y/N) [N]:
>> Continuing will cancel these connections:
>> G: \\myserver\myshare
>> Do you want to continue this operation? (Y/N) [N]:
>>
>> I answer Y to all three of these and it logs me out.
>>
>> Question is, is there a way to pass these key strokes through so I don't
>> have to hit them?  I know, just being lazy.  But I would like to do this,
>> will save me some time.
>>
>> I tried:
>> a:\logoff Y Y Y
>> a:\logoff < logoff.txt
>>
>> Where logoff.txt contains:
>> Y
>> Y
>> Y
>>
>> Neither worked.  Any other suggestions?
>>
>> Thanks in advance,
>> Linn
>
> What operating system do you have on your boot floppy? DOS 7?
It's PC DOS Version 7.1 Rev. 0
Author
23 Jan 2009 11:25 PM
Pegasus (MVP)
"Linn Kubler" <lkub***@chartwellwisc2.com> wrote in message
news:uN78BqWfJHA.3728@TK2MSFTNGP06.phx.gbl...
>
>> What operating system do you have on your boot floppy? DOS 7?
> It's PC DOS Version 7.1 Rev. 0

It's quite a few years since I played with my DOS network boot disks and
they have fallen somewhat into disrepair. Since you use this facility
rarely, it would probably take me more time to work out an answer than it
takes you to respond to the chain of prompts over a couple of years . . . I
therefore won't persist.
Author
25 Jan 2009 4:37 PM
Tom_Slycke
Show quote Hide quote
"Linn Kubler" <lkub***@chartwellwisc2.com> wrote in message
news:OudKLfLfJHA.3668@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> I have a boot floppy for booting my computer to connect to the network so
> I can run Ghost and image my machine.  I wrote a little batch file called
> logoff.bat for loging off the network when I'm finished.
>
> Logoff.bat contains:
> @net stop
>
> When it runs it prompts me for three different responses:
> Stopping the NETBEUI service also stops these services:
> REQUESTER
> Do you want to continue this operation? (Y/N) [Y]:
> You are currently logged on as Me.
> Do you want to log off? (Y/N) [N]:
> Continuing will cancel these connections:
> G: \\myserver\myshare
> Do you want to continue this operation? (Y/N) [N]:
>
> I answer Y to all three of these and it logs me out.
>
> Question is, is there a way to pass these key strokes through so I don't
> have to hit them?  I know, just being lazy.  But I would like to do this,
> will save me some time.
>
> I tried:
> a:\logoff Y Y Y
> a:\logoff < logoff.txt
>
> Where logoff.txt contains:
> Y
> Y
> Y
>
> Neither worked.  Any other suggestions?
>
> Thanks in advance,
> Linn
>
>

Try this
- Create a text file with your responses... your logoff.txt file looks good,
make sure there is a carriage return after that last "y"
- instead of executing  a:\logoff
us
type logoff.txt | logoff

This will pipe the response file as input into the logoff program.

Tom
Author
25 Jan 2009 5:07 PM
Al Dunbar
Show quote Hide quote
"Tom_Slycke" <tom_sl***@cox.net> wrote in message
news:5z0fl.4214$E%6.3459@newsfe04.iad...
>
> "Linn Kubler" <lkub***@chartwellwisc2.com> wrote in message
> news:OudKLfLfJHA.3668@TK2MSFTNGP03.phx.gbl...
>> Hi,
>>
>> I have a boot floppy for booting my computer to connect to the network so
>> I can run Ghost and image my machine.  I wrote a little batch file called
>> logoff.bat for loging off the network when I'm finished.
>>
>> Logoff.bat contains:
>> @net stop
>>
>> When it runs it prompts me for three different responses:
>> Stopping the NETBEUI service also stops these services:
>> REQUESTER
>> Do you want to continue this operation? (Y/N) [Y]:
>> You are currently logged on as Me.
>> Do you want to log off? (Y/N) [N]:
>> Continuing will cancel these connections:
>> G: \\myserver\myshare
>> Do you want to continue this operation? (Y/N) [N]:
>>
>> I answer Y to all three of these and it logs me out.
>>
>> Question is, is there a way to pass these key strokes through so I don't
>> have to hit them?  I know, just being lazy.  But I would like to do this,
>> will save me some time.
>>
>> I tried:
>> a:\logoff Y Y Y
>> a:\logoff < logoff.txt
>>
>> Where logoff.txt contains:
>> Y
>> Y
>> Y
>>
>> Neither worked.  Any other suggestions?
>>
>> Thanks in advance,
>> Linn
>>
>>
>
> Try this
> - Create a text file with your responses... your logoff.txt file looks
> good, make sure there is a carriage return after that last "y"
> - instead of executing  a:\logoff

he didn't just execute "A:\logoff", he redirected his reponse file into it
using redirection

> us
> type logoff.txt | logoff
>
> This will pipe the response file as input into the logoff program.

If the executable were actually reading its input from stdin, redirection
and piping would both work. Since it appears to not be reading from stdin,
then neither will work.

/Al
Author
25 Jan 2009 6:37 PM
Tom_Slycke
Show quote Hide quote
"Al Dunbar" <aland***@hotmail.com> wrote in message
news:eNsdi9wfJHA.3708@TK2MSFTNGP04.phx.gbl...
>
> "Tom_Slycke" <tom_sl***@cox.net> wrote in message
> news:5z0fl.4214$E%6.3459@newsfe04.iad...
>>
>> "Linn Kubler" <lkub***@chartwellwisc2.com> wrote in message
>> news:OudKLfLfJHA.3668@TK2MSFTNGP03.phx.gbl...
>>> Hi,
>>>
>>> I have a boot floppy for booting my computer to connect to the network
>>> so I can run Ghost and image my machine.  I wrote a little batch file
>>> called logoff.bat for loging off the network when I'm finished.
>>>
>>> Logoff.bat contains:
>>> @net stop
>>>
>>> When it runs it prompts me for three different responses:
>>> Stopping the NETBEUI service also stops these services:
>>> REQUESTER
>>> Do you want to continue this operation? (Y/N) [Y]:
>>> You are currently logged on as Me.
>>> Do you want to log off? (Y/N) [N]:
>>> Continuing will cancel these connections:
>>> G: \\myserver\myshare
>>> Do you want to continue this operation? (Y/N) [N]:
>>>
>>> I answer Y to all three of these and it logs me out.
>>>
>>> Question is, is there a way to pass these key strokes through so I don't
>>> have to hit them?  I know, just being lazy.  But I would like to do
>>> this, will save me some time.
>>>
>>> I tried:
>>> a:\logoff Y Y Y
>>> a:\logoff < logoff.txt
>>>
>>> Where logoff.txt contains:
>>> Y
>>> Y
>>> Y
>>>
>>> Neither worked.  Any other suggestions?
>>>
>>> Thanks in advance,
>>> Linn
>>>
>>>
>>
>> Try this
>> - Create a text file with your responses... your logoff.txt file looks
>> good, make sure there is a carriage return after that last "y"
>> - instead of executing  a:\logoff
>
> he didn't just execute "A:\logoff", he redirected his reponse file into it
> using redirection
>
>> us
>> type logoff.txt | logoff
>>
>> This will pipe the response file as input into the logoff program.
>
> If the executable were actually reading its input from stdin, redirection
> and piping would both work. Since it appears to not be reading from stdin,
> then neither will work.
>
> /Al
>
>


oopps... point taken