Search found 5 matches
- 02 Apr 2015 10:34
- Forum: DOS Batch Forum
- Topic: Checking input for special characters
- Replies: 15
- Views: 7908
Re: Checking input for special characters
@foxidrive @echo off set "replace=%~1" set "string=" for /f "delims=" %%a in ('echo("%replace%"^|repl "[a-zA-Z0-9\x22]" "" x ') do set "string=%%a" if defined string (echo illegal characters detected) else (echo all ok!) pause Tha...
- 02 Apr 2015 05:22
- Forum: DOS Batch Forum
- Topic: Checking input for special characters
- Replies: 15
- Views: 7908
Re: Checking input for special characters
@Squashman. Thank you for letting me know the new version. But as for me the older version seems more suitable since I have to search and replace the same string on multiple files. I can add on the required files on my main script and call repl to search and replace. And I was not able to figure out...
- 01 Apr 2015 11:54
- Forum: DOS Batch Forum
- Topic: Checking input for special characters
- Replies: 15
- Views: 7908
Re: newbie to batch
@Squashman Thats pretty long code, got it from m @ShadowThief I mean anything other than alphabets and numericals thought of doing with 'sed' pretty cool command in linux. Got to know we can execute it in windows as well by installing sed utility, but my concern here is to find whether entered argum...
- 01 Apr 2015 08:46
- Forum: DOS Batch Forum
- Topic: Checking input for special characters
- Replies: 15
- Views: 7908
Re: newbie to batch
I have reached till here... The below script replaces the "old name" with "new name", I got a replace function "replace.bat" which does that. Now I need to make sure the second argument does not contain any special characters it it before replacing "old name" ...
- 01 Apr 2015 06:23
- Forum: DOS Batch Forum
- Topic: Checking input for special characters
- Replies: 15
- Views: 7908
Checking input for special characters
Could any one help on this.
Need to check if the entered argument has any special characters in it and throw an error/exit if it has any.
Need to check if the entered argument has any special characters in it and throw an error/exit if it has any.