Search found 8 matches
- 27 Apr 2017 09:01
- Forum: DOS Batch Forum
- Topic: Need help SET /P variable=[promptString]
- Replies: 6
- Views: 4252
Re: Need help SET /P variable=[promptString]
Now I find the above a bit confusing because in the next command, there is no problem with the pipe to egrep. echo|set /p="clear;echo Hub7;ssh -q 169.254.64.112 ethtool eth2|egrep 'Speed|Duplex|Auto-neg|Link';echo Hub8;ssh -q 169.254.64.128 ethtool eth2|egrep 'Speed|Duplex|Auto-neg|Link'"|...
- 27 Apr 2017 08:53
- Forum: DOS Batch Forum
- Topic: Need help SET /P variable=[promptString]
- Replies: 6
- Views: 4252
Re: Need help SET /P variable=[promptString]
If the quotation mark next to done belongs to your command line you have to add it also with three carets escaped (because it's an unbalanced quotation mark). <nul set /p "=for b in 01 02 03 04 05 06 07 08 09 10 11 12 13 14; do echo;echo "BLADE ${b}";ssh -q `hostname | cut -d "-...
- 27 Apr 2017 08:51
- Forum: DOS Batch Forum
- Topic: Need help SET /P variable=[promptString]
- Replies: 6
- Views: 4252
Re: Need help SET /P variable=[promptString]
The pipe character '|' has a special meaning (the same as in linux) and has to be escaped (using '^'), if you want to use it as a simple text (outside of doublequotes). Because you redirect the output of a command to clip (using the pipe) the command line interpreter processes the command twice: 1....
- 26 Apr 2017 14:07
- Forum: DOS Batch Forum
- Topic: Need help SET /P variable=[promptString]
- Replies: 6
- Views: 4252
Need help SET /P variable=[promptString]
Good day. I've been trying to load the DOS prompt with the following Linux command using echo, set /p and clip in a DOS prompt session. Here is the Linux one-liner to check the uptime for 14 blades on a server: for b in 01 02 03 04 05 06 07 08 09 10 11 12 13 14; do echo;echo "BLADE ${b}";s...
- 15 Jan 2016 11:15
- Forum: DOS Batch Forum
- Topic: Variable check in a DOS batch script does not work
- Replies: 5
- Views: 3165
Re: Variable check in a DOS batch script does not work
Ok, stand down, I found found the problem. I had another line before the check.
Thanks for your responses.
Bjoern
Thanks for your responses.
Bjoern
- 15 Jan 2016 11:00
- Forum: DOS Batch Forum
- Topic: Variable check in a DOS batch script does not work
- Replies: 5
- Views: 3165
Re: Variable check in a DOS batch script does not work
Squashman wrote:I copied and pasted your exact code into a batch file and it works as it is intended to.
Which version are you running?
Code: Select all
C:\>ver
Microsoft Windows [Version 6.1.7601]
- 15 Jan 2016 09:45
- Forum: DOS Batch Forum
- Topic: Variable check in a DOS batch script does not work
- Replies: 5
- Views: 3165
Variable check in a DOS batch script does not work
Good day all. For some unknown reason, if I omitt the hostname, it does not echo the message and go back to start. :start cls set host= echo. set /p host= Enter the Hostname: if "%host%"=="" echo Please enter a valid host. & timeout 3 & goto start Any ideas? Regards, Bjoern
- 29 Apr 2015 11:48
- Forum: DOS Batch Forum
- Topic: Need advise launching 2013 Outlook from a DOS command line
- Replies: 1
- Views: 1774
Need advise launching 2013 Outlook from a DOS command line
Good day. I've been trying to launch an email from a DOS command line using the string shown below. The Microsoft Outlook version is 2013, OS is Windows 7. The command works without the variables, %subj% and %site%; I've tried various permutations, ie. %subj% %%subj ^%subj% ^%subj^% \%subj%, none of...