Search found 546 matches

by SIMMS7400
17 Sep 2024 03:36
Forum: DOS Batch Forum
Topic: For loop value with spaces
Replies: 1
Views: 37907

Re: For loop value with spaces

I looks like I can just do this, so simple :

Code: Select all

SET "AUTOMATCH=%~1"

Code: Select all

FOR %%A IN ("%AUTOMATCH:,=" "%") DO (
by SIMMS7400
16 Sep 2024 17:20
Forum: DOS Batch Forum
Topic: For loop value with spaces
Replies: 1
Views: 37907

For loop value with spaces

Hi All - I am reaching out to see if there is a cleaner way to prepare a passed value for use in a for loop. For instance, I'm passing this value to a function : CALL :TEST "ACR_US Bank_Regions,AR_EFT" However, I need to iterate over both values, but space is considered a delimiter. So I am doing th...
by SIMMS7400
04 May 2024 11:41
Forum: DOS Batch Forum
Topic: Mask password with Asterisk
Replies: 16
Views: 46182

Re: Mask password with Asterisk

Paste doesn't work on that piece of code either
by SIMMS7400
03 May 2024 02:46
Forum: DOS Batch Forum
Topic: Mask password with Asterisk
Replies: 16
Views: 46182

Re: Mask password with Asterisk

Is there a way to paste a password into Antonio's solution instead of fully type it out?
by SIMMS7400
03 May 2024 02:10
Forum: DOS Batch Forum
Topic: Mask password with Asterisk
Replies: 16
Views: 46182

Re: Mask password with Asterisk

Is there a way to paste a password into Antonio's solution instead of fully type it out?
by SIMMS7400
08 Apr 2024 16:35
Forum: DOS Batch Forum
Topic: How to dynamically escape % symbols?
Replies: 4
Views: 10078

Re: How to dynamically escape % symbols?

We have automation passwords that need to be encrypted for our financial applications. We have a password generator/randomizer that we use. When % symbols are present, we need to remember to always escape them, however, a lot of the folks forget to do that. Without further description of the involv...
by SIMMS7400
04 Apr 2024 15:53
Forum: DOS Batch Forum
Topic: How to dynamically escape % symbols?
Replies: 4
Views: 10078

How to dynamically escape % symbols?

Hi All - We have automation passwords that need to be encrypted for our financial applications. We have a password generator/randomizer that we use. When % symbols are present, we need to remember to always escape them, however, a lot of the folks forget to do that. Let's say I have a string : O*!)v...
by SIMMS7400
05 Sep 2023 04:32
Forum: DOS Batch Forum
Topic: Safer way to parse curl output?
Replies: 4
Views: 25927

Re: Safer way to parse curl output?

Thank you so much, Aacini - this way is very slick!!! I'll use this. Thanks again! This is the way I would do it: @echo off setlocal set "CurlResp={"device_code":"f00b07aab09048268c78787c7f878787","user_code":"HFYRBFJF","verification_uri":"https://idcs-zzzzzzzzzzd.identity.cloud ... es_in":300}" rem...
by SIMMS7400
29 Aug 2023 07:31
Forum: DOS Batch Forum
Topic: Safer way to parse curl output?
Replies: 4
Views: 25927

Safer way to parse curl output?

HI All - I have the following piece of code that is working as expected. FOR /F "tokens=2,4 delims=:," %%A IN (' curl --location --request POST "%IDCS_URL%/oauth2/v1/device" ^ --header "Content-Type: application/x-www-form-urlencoded;charset=utf-8" ^ --data-urlencode "response_type=device_code" ^ --...
by SIMMS7400
10 Aug 2023 09:14
Forum: DOS Batch Forum
Topic: Trouble with ROBOCOPY - copy files to destination that don't already exist
Replies: 3
Views: 16225

Trouble with ROBOCOPY - copy files to destination that don't already exist

HI All - I have a few folders & contents (including subdirecotries) I need to copy from source to target. I need to do this frequently but what's happening is that it's copying everything each time I run the ROBOCOPY. I've tried to modiy it but having no luck. Here's what I have: ROBOCOPY "source" "...
by SIMMS7400
21 Jul 2023 02:39
Forum: DOS Batch Forum
Topic: Clearing an array is done as a partial match? Why?
Replies: 1
Views: 2666

Clearing an array is done as a partial match? Why?

HI All - I have the following Array/List setup. The first position in the list is a filename mask. What's interesting is if I have 2 like file names but still unique, when I clear the array before each iteration, the other like array definition is cleared too. For instance, when running the below co...
by SIMMS7400
28 May 2023 08:29
Forum: DOS Batch Forum
Topic: How to clear an array?
Replies: 9
Views: 10964

How to clear an array?

Hi Guys - This may be a silly question, but is there a way to clear an array without looping through and explicitly clearing each value? THis is what I'm doing now: REM Clear Array FOR /L %%A IN (1,1,100) DO ( SET "STR[DC%%~A].DLR=" SET "STR[DC%%~A].LOC=" SET "STR[DC%%~A].IMP=" ) I'm hoping there's ...
by SIMMS7400
11 Feb 2022 10:34
Forum: DOS Batch Forum
Topic: How to spool batch script logic to create another batch script but not expanded?
Replies: 5
Views: 8062

Re: How to spool batch script logic to create another batch script but not expanded?

HI Squash & Team - Yes, you're right. I'm sorry. It was the last paren in the for loop causing the issue, I should have known. Final : SETLOCAL ENABLEDELAYEDEXPANSION SET "EXCLUSION_LIST=Automation_Parameters.ps1,Encrypt_Credentials.ps1,Download_Backup.ps1" SET "EXT=cmd" REM Read PS1 files from this...
by SIMMS7400
06 Feb 2022 05:54
Forum: DOS Batch Forum
Topic: How to spool batch script logic to create another batch script but not expanded?
Replies: 5
Views: 8062

Re: How to spool batch script logic to create another batch script but not expanded?

THanks, Terry! That did the trick, but having one issue where when trying to redirect a for loop command, it's recognizing the DO. Here is my almost finished code: @ECHO OFF REM Read PS1 files from this directory PUSHD "..\PS1" FOR %%A IN ("*") DO ( REM Ensure cmd is purged before writing to it DEL ...
by SIMMS7400
06 Feb 2022 05:19
Forum: DOS Batch Forum
Topic: How to spool batch script logic to create another batch script but not expanded?
Replies: 5
Views: 8062

How to spool batch script logic to create another batch script but not expanded?

Hi Guys - I have the following piece of code that I need to spool to another batch script. However, when I redirect, the functions/variables are done so expanded which isn't right. I need to pool this piece of code to "Testbatch.cmd": >>"..\Batch\TestBatch.cmd" ( @ECHO OFF SET "Script=%~n0" FOR /F %...