Search found 75 matches
- 13 Aug 2016 13:33
- Forum: DOS Batch Forum
- Topic: Creating a script to gather PC information - to assist those asking for help
- Replies: 167
- Views: 151266
Re: Creating a script to gather PC information - to assist those asking for help
I've been out herding the kangaroos and only just got back after one escaped... Is this a metaphor for being busy, or have you actually been chasing down marsupials? but I do like the idea of reporting details when 1) Certain commands are missing or if they have the wrong extension (say a .bat exte...
- 12 Aug 2016 19:45
- Forum: DOS Batch Forum
- Topic: Creating a script to gather PC information - to assist those asking for help
- Replies: 167
- Views: 151266
Re: Creating a script to gather PC information - to assist those asking for help
Imagine the questioners script would look like that @echo off &setlocal set /p "path=Enter the path: " echo "%path%"|find "C:" pause This will crash for sure. But it wouldn't even help if you check the path variable in another script. Most likely it would be ok. Ah...
- 12 Aug 2016 15:09
- Forum: DOS Batch Forum
- Topic: Creating a script to gather PC information - to assist those asking for help
- Replies: 167
- Views: 151266
Re: Creating a script to gather PC information - to assist those asking for help
⋅ Get the values of some key environment variables, like Path and PATHEXT, to make sure they're not corrupted. OK, I agree. Although most of the time predefined variables are rather overwritten than corrupted. In that case you have to know the complete batch code of the questioner. Output...
- 11 Aug 2016 17:49
- Forum: DOS Batch Forum
- Topic: Short code to retype
- Replies: 1
- Views: 2312
Re: Short code to retype
While batch and shell scripts both use command lines, those commands are sent to entirely different programs: Batch scripts are interpreted by cmd.exe on Windows, and shell scripts are interpreted by any of several programs (sh, bash, ksh) on *nix and OS X. These programs support a different set of ...
- 11 Aug 2016 17:27
- Forum: DOS Batch Forum
- Topic: Creating a script to gather PC information - to assist those asking for help
- Replies: 167
- Views: 151266
Re: Creating a script to gather PC information - to assist those asking for help
Getting the Windows version is great, since it tells us what commands should be available on their system. To further that, maybe have a sticky post with a list of what commands should be available on which OS, for reference by helpers. What should be true often isn't, though, so maybe collect some ...
- 05 Aug 2016 16:40
- Forum: DOS Batch Forum
- Topic: How to store multiple selections from menu prompts?
- Replies: 11
- Views: 6713
Re: How to store multiple selections from menu prompts?
. . .the portion where I need to perform the copy happens later on in the script, not necessarily within the block. Is there anyway to store %%~i so I can use it later on in the script? You don't need to store the %%~i variable; it is internal to the FOR command, which is acting on the variable whe...
- 05 Aug 2016 15:51
- Forum: DOS Batch Forum
- Topic: How to store multiple selections from menu prompts?
- Replies: 11
- Views: 6713
Re: How to store multiple selections from menu prompts?
Users may not get the list completely right the first time. Expanding on aGerman's code and your error-checking steps gives something like @echo off &setlocal :get_dirs set /p "new_dirs=Comma separated directories: " set "all_dirs=%all_dirs%, %new_dirs%" :confirm echo "I...
- 05 Aug 2016 15:20
- Forum: DOS Batch Forum
- Topic: Batch to Batch (Simple Question....I hope)
- Replies: 7
- Views: 5426
Re: Batch to Batch (Simple Question....I hope)
@aGerman
That's what I get for not thoroughly reading the responses. You're quite right. I was just focused on fixing how to call the child scripts.
@craving94509
aGerman's answer is better than mine. Offer stands, if you want to understand why it didn't work before.
That's what I get for not thoroughly reading the responses. You're quite right. I was just focused on fixing how to call the child scripts.
@craving94509
aGerman's answer is better than mine. Offer stands, if you want to understand why it didn't work before.
- 05 Aug 2016 14:35
- Forum: DOS Batch Forum
- Topic: Batch to Batch (Simple Question....I hope)
- Replies: 7
- Views: 5426
Re: Batch to Batch (Simple Question....I hope)
Ultimately I would like to have a single .bat that does the following: CD "C:\IBM\SMP\maximo\tools\maximo CMD.EXE /K "C:\IBM\SMP\maximo\tools\maximo\updatedb.bat" CD "C:\IBM\SMP\maximo\tools\maximo CMD.EXE /K "C:\IBM\SMP\maximo\tools\maximo\configdb.bat" CD "C:\IB...
- 02 Aug 2016 19:32
- Forum: DOS Batch Forum
- Topic: Can't get returnvalue from called batch file
- Replies: 21
- Views: 13308
Re: Can't get returnvalue from called batch file
Bitwise operator. set /? shows the list buried in there someplace. ⋅ Sunday afternoon: Prof. Foxy says "Look it up." - " Fine. When all else fails, read the directions." ⋅ Sunday evening: Go read the documentation. - "Oh, wow, there's like six cool thi...
- 29 Jul 2016 17:58
- Forum: DOS Batch Forum
- Topic: CMD 'Where' function
- Replies: 17
- Views: 12178
Re: CMD 'Where' function
Hi Simms It's just not clear to me why you need to know the drive letter at all. I understand that different servers use different drive letters, but as long as the path to Tools\Binn\ is in the PATH environment variable, it shouldn't matter. When you run a command at the prompt, CMD searches throug...
- 29 Jul 2016 17:16
- Forum: DOS Batch Forum
- Topic: Can't get returnvalue from called batch file
- Replies: 21
- Views: 13308
Re: Can't get returnvalue from called batch file
I never had programmed a Roman to Decimal numerals conversion (just the opposite one); so this is my version Nice! We've gone from 600 lines, to 100, to 30. I like that you've combined the conversion and addition into one pass per character. It seemed like there ought to be a way, but I couldn't qu...
- 29 Jul 2016 09:39
- Forum: DOS Batch Forum
- Topic: Can't get returnvalue from called batch file
- Replies: 21
- Views: 13308
Re: Can't get returnvalue from called batch file
Hi Avanatus. Sorry I couldn't get back to you yesterday. I'm not sure why it's not working within the loop. It may have something to do with nested calls. I found some DDS files to work with, and went through your scripts. Things were more complicated in a number of places than I think they needed t...
- 27 Jul 2016 15:37
- Forum: DOS Batch Forum
- Topic: Can't get returnvalue from called batch file
- Replies: 21
- Views: 13308
Re: Can't get returnvalue from called batch file
The issue is that, due to multiple nested CALLs, you've got three ENDLOCAL barriers to cross, but RETURNVALUE is only making it across one of them. I've been assuming that the :SETCodeEnd segment was the last thing in the called file, when in fact it's the innermost layer of four. We actually should...
- 27 Jul 2016 14:26
- Forum: DOS Batch Forum
- Topic: Can't get returnvalue from called batch file
- Replies: 21
- Views: 13308
Re: Can't get returnvalue from called batch file
Are these smaller test files, or have you been updating the full originals? In either case, please go ahead and post the full file contents again, so we can be sure we're not missing any important context.