piping 'y \r' to a set net time command.

  • Thread starter Thread starter Rowan
  • Start date Start date
R

Rowan

I'm writing a logon script and I need a way to pipe a 'y' and carriage
return to the set net time /domain:nnn set command
I figured echo 'y \r' | set net time /domain:nnn /set should work but
it's not sending the carriage return.
 
There is no need to pipe "y" into this command - it has
its own inbuilt switch:

net time \\SomeServer /set /yes
 
that works for date I should have been more specific and said how do you
pipe a charactor followed by a carraige return.
 
This is the easy bit: Every "echo" command pipes a carriage
return into the destination. Try this to prove it:

echo.>c:\test.txt

If you examine test.txt with a binary editor then you will find
that it contains exactly two hex chars: $0d $0a (=CR LF).
To pipe a character without CRLF is possible but much harder!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top