Search found 32 matches

by Quisquose
03 Nov 2018 15:12
Forum: DOS Batch Forum
Topic: Code snippet inadvertently prevents console title renaming
Replies: 3
Views: 729

Re: Code snippet inadvertently prevents console title renaming

Just tried your code and made the first line of the code be a TITLE statement. Then put more TITLE statements in the code. The Window Title changed every time. Thank you for letting me know the result of your testing, Squashman. It seems as if these things are never as straight-forward as I imagine...
by Quisquose
03 Nov 2018 02:51
Forum: DOS Batch Forum
Topic: Code snippet inadvertently prevents console title renaming
Replies: 3
Views: 729

Code snippet inadvertently prevents console title renaming

I've been experimenting setting up different console sessions (configured for different purposes) using basic commands like title, color, prompt etc. via the cmd.exe /K switch. After much trial and error (mainly error) I mostly got things working as I wanted. However there were certain instances whe...
by Quisquose
28 Oct 2018 16:44
Forum: DOS Batch Forum
Topic: Getting >nul 2>&1 to work within a batch file
Replies: 12
Views: 1643

Re: Getting >nul 2>&1 to work within a batch file

Aacini wrote:
28 Oct 2018 14:57
As I understand it, they want to enter "closeall" from the keyboard only ...
Correct.
by Quisquose
28 Oct 2018 10:11
Forum: DOS Batch Forum
Topic: Getting >nul 2>&1 to work within a batch file
Replies: 12
Views: 1643

Re: Getting >nul 2>&1 to work within a batch file

This should work: doskey closeall=taskkill /IM "cmd.exe" /f ^>nul 2^>^&1 Thank you SO much, Antonio. This works perfectly, and it's exactly what I wanted. 8) This time I will make a careful note of how it's done, so that I can use it as a template guide for achieving a similar effect for other comm...
by Quisquose
28 Oct 2018 01:53
Forum: DOS Batch Forum
Topic: Getting >nul 2>&1 to work within a batch file
Replies: 12
Views: 1643

Re: Getting >nul 2>&1 to work within a batch file

You can, however, set "closeall=taskkill /IM "cmd.exe" /f >nul 2>&1" %closeall% Thank you, This now hides the output, but in order to get it to work I have to type %closeall% including the percentage marks. How can I get it to work with just the word closeall on its own? I had a similar issue to th...
by Quisquose
27 Oct 2018 17:48
Forum: DOS Batch Forum
Topic: Getting >nul 2>&1 to work within a batch file
Replies: 12
Views: 1643

Getting >nul 2>&1 to work within a batch file

How do I get the following command to work from within a batch file? doskey closeall=taskkill /IM "cmd.exe" /f >nul 2>&1 I want the output of taskkill to be suppressed. It works perfectly if typed at the command line, but when the above command is used in a batch file, you still see the output text ...
by Quisquose
14 Aug 2017 19:19
Forum: DOS Batch Forum
Topic: Using Doskey macro to run Choice
Replies: 5
Views: 1266

Re: Using Doskey macro to run Choice

Thanks for your reply, but I'm having trouble understanding it. To clarify what I am trying to achieve: In the batch file that I showed in the first message of this thread, I want only the code that is before/above the :choice command to run by default when the batch file is run (the rest of the cod...
by Quisquose
26 Jul 2017 05:24
Forum: DOS Batch Forum
Topic: Using Doskey macro to run Choice
Replies: 5
Views: 1266

Using Doskey macro to run Choice

I am trying to learn a bit more about the very basics of batch files, so I am messing around with a simple batch that I am testing as an autorun script for an elevated privileges cmd prompt window. The autorun batch file is basically just a few commands that run on startup of the command window (in ...
by Quisquose
24 Jul 2017 02:47
Forum: DOS Batch Forum
Topic: Doskey doesn't recognize its own macros
Replies: 15
Views: 2363

Re: Doskey doesn't recognize its own macros

I think you never mentioned before that you used a batch file.Steffen I did, actually. I am using a stripped down batch file shown below. (I removed various other macros and comments from my main batch file for purpose of testing). I even posted a full copy of the batch file that I was using: @ECHO...
by Quisquose
23 Jul 2017 18:38
Forum: DOS Batch Forum
Topic: Doskey doesn't recognize its own macros
Replies: 15
Views: 2363

Re: Doskey doesn't recognize its own macros

OK, final update. I have managed to fix it myself (which I can't quite believe). I was trying out various different things and I ended up running the command doskey / macros to see if there were any clues in the output. Doskey listed all of my macros exactly as I had entered them into my batch file,...
by Quisquose
23 Jul 2017 17:36
Forum: DOS Batch Forum
Topic: Doskey doesn't recognize its own macros
Replies: 15
Views: 2363

Re: Doskey doesn't recognize its own macros

Further to my post above, I have now tracked down the issue. It wasn't any kind of system problem, but rather just something specific to the way that I was using the commands on my main system compared to what I did differently when using the virtual machine. The purpose of me creating these macros ...
by Quisquose
23 Jul 2017 16:22
Forum: DOS Batch Forum
Topic: Doskey doesn't recognize its own macros
Replies: 15
Views: 2363

Re: Doskey doesn't recognize its own macros

Thanks for doing that test. As I mentioned in my last post, I had eliminated psexec as the source of the problem because I experienced exactly the same issue when I did a test using just notepad on its own. I therefore decided to try doing another test, but this time on a virtual machine, and it wor...
by Quisquose
23 Jul 2017 12:59
Forum: DOS Batch Forum
Topic: Doskey doesn't recognize its own macros
Replies: 15
Views: 2363

Re: Doskey doesn't recognize its own macros

Ok, I have done some more testing and it does not seem to be psexec that is the problem. The problem is specifically with the command %$*% . I'm not sure what it's doing, but it is not enclosing the text with percentage signs (at least not on my system). I tried using notepad as a test (to remove ps...
by Quisquose
23 Jul 2017 11:50
Forum: DOS Batch Forum
Topic: Doskey doesn't recognize its own macros
Replies: 15
Views: 2363

Re: Doskey doesn't recognize its own macros

Hi, the problem is something to do with this line: doskey su=psexec -s -i %$*% If I remove the % marks from before and after $* and then type su %regwork% , then it works fine. But if I use the command shown above (which is what you gave me to have the macro perform the expansion itself) then it doe...
by Quisquose
23 Jul 2017 06:14
Forum: DOS Batch Forum
Topic: Doskey doesn't recognize its own macros
Replies: 15
Views: 2363

Re: Doskey doesn't recognize its own macros

This is exactly the kind of solution that I was hoping for. Thank you. Unfortunately I can't get it to work though. I am using a stripped down batch file shown below. (I removed various other macros and comments from my main batch file for purpose of testing). @ECHO Microsoft Windows [Version 6.1.76...