Search found 174 matches

by siberia-man
22 Apr 2014 03:23
Forum: DOS Batch Forum
Topic: Powershell2/bat hybrid?
Replies: 25
Views: 45606

Re: Powershell2/bat hybrid?

Thanks for updates, npocmaka_. I knew that suggestion had problems.
by siberia-man
21 Apr 2014 14:44
Forum: DOS Batch Forum
Topic: Powershell2/bat hybrid?
Replies: 25
Views: 45606

Re: Powershell2/bat hybrid?

Hi npocmaka_ , could you test this code below with more complex scenarios? Does it work properly? Does it support command line arguments? I have googled this issue and found few good ideas that inspired me to produce the following ugly but working code: @echo off powershell -Command Invoke-Expressio...
by siberia-man
21 Apr 2014 04:21
Forum: DOS Batch Forum
Topic: js/vbs/html/hta and more hybrids and chimeras in cmd/bat
Replies: 61
Views: 174684

Re: js/vbs/html/hta hybrids and chimeras in cmd/bat

I copied and pasted the code from the post by aGerman. I can see those ascii26 AFTER each apostrophs.
by siberia-man
21 Apr 2014 03:43
Forum: DOS Batch Forum
Topic: js/vbs/html/hta and more hybrids and chimeras in cmd/bat
Replies: 61
Views: 174684

js/vbs/html/hta and more hybrids and chimeras in cmd/bat

* * * * * * Everything here below is correct. However during discussions some parts of this message became obsolete. The resulting message accumulating all good points of this thread is located by the following link: https://www.dostips.com/forum/viewtopic.php?p=63940#p63940 Briefly. In this thread...
by siberia-man
16 Apr 2014 07:19
Forum: DOS Batch Forum
Topic: Powershell2/bat hybrid?
Replies: 25
Views: 45606

Re: Powershell2/bat hybrid?

Code: Select all

type filename.bat | powershell -c -
by siberia-man
14 Apr 2014 04:03
Forum: DOS Batch Forum
Topic: WMIC and FOR /F : A fix for the trailing <CR> problem
Replies: 21
Views: 20884

Re: WMIC and FOR /F : A fix for the trailing <CR> problem

Code: Select all

for /f "tokens=*" %a in ( 'wmic os get localDateTime /value' ) do @call echo [%a]


And much better

Code: Select all

for /f "tokens=*" %a in ( 'wmic os get localDateTime /value ^| findstr "."' ) do @call echo [%a]
by siberia-man
07 Feb 2014 16:02
Forum: DOS Batch Forum
Topic: UNPATH: the script for removing elements from the PATH
Replies: 4
Views: 2631

Re: UNPATH: the script for removing elements from the PATH

Squashman,

Agree. I understood your point. I added one sentence in bold to the first port.
by siberia-man
07 Feb 2014 15:27
Forum: DOS Batch Forum
Topic: UNPATH: the script for removing elements from the PATH
Replies: 4
Views: 2631

Re: UNPATH: the script for removing elements from the PATH

But this would only change the path for the current environment you are in. As soon as you close that environment out and start a new one the PATH would change back to whatever is set in the registry. To permanently change the path variable you would either need to edit the registry directly or use...
by siberia-man
07 Feb 2014 13:40
Forum: DOS Batch Forum
Topic: UNPATH: the script for removing elements from the PATH
Replies: 4
Views: 2631

UNPATH: the script for removing elements from the PATH

Once I decided to to implement the simple tool to cleanup the PATH variable removing some elements there. I'd like to do this in the easiest way that would allowed to remove a set of elements at once. I did it. Here you are. There is the UNPATH tool having opposite effect to the PATH command. I trie...
by siberia-man
28 Jan 2014 16:31
Forum: DOS Batch Forum
Topic: comparision of two commands output in UNIX/LINUX
Replies: 2
Views: 1784

Re: comparision of two commands output in UNIX/LINUX

Have you ever read the mantra of differences?
Maybe you need use comm

Code: Select all

comm -23 file1 file2
by siberia-man
12 Jan 2014 04:13
Forum: DOS Batch Forum
Topic: BinToBat.bat - Easily install files of any type or size!
Replies: 25
Views: 22955

Re: BinToBat.bat - Easily install files of any type or size!

Hi Antonio, Thank you for your response. Take a look on my critics =) I don't like the /* multi-line comment */ method because the */ closing characters may be easily ignored by people that don't know JScript. Remember that the primary audience for all these programs are Batch file programmers (this...
by siberia-man
12 Jan 2014 03:50
Forum: DOS Batch Forum
Topic: Move files with condition
Replies: 15
Views: 7433

Re: Move files with condition

It is not clear from the first post whether .IMG and .XML should be moved consequentially or separately. So the code below implements moving of all available files FILENAME having the pair file called FILENAME.DONE. As I understood from the discussions .DONE files will be removed after movement of s...
by siberia-man
10 Jan 2014 08:07
Forum: DOS Batch Forum
Topic: BinToBat.bat - Easily install files of any type or size!
Replies: 25
Views: 22955

Re: BinToBat.bat - Easily install files of any type or size!

Aacini , you have posted very interesting solution at your first post. I've just began to learn it and found the weird code. Could you give more details on it? // Encode <number of spaces> while ( inputLine.charAt(spaces) == " " ) spaces++; if ( 3 <= spaces && spaces <= 29 ) { out...
by siberia-man
09 Jan 2014 00:10
Forum: DOS Batch Forum
Topic: Ways to aware that some string contains a substrings
Replies: 24
Views: 12829

Re: Ways to aware that some string contains a substrings

Squashman wrote:But then your script doesn't become very portable if others need to use it.

yes or not - depends on tasks. The proper organization of a code could minimize influence of environment. Moreover, we could hide all differences into configuration files.
by siberia-man
08 Jan 2014 07:33
Forum: DOS Batch Forum
Topic: Ways to aware that some string contains a substrings
Replies: 24
Views: 12829

Re: Ways to aware that some string contains a substrings

so why don't you show more on your specific cases. help us to help you. surely you can't expect others to guess what's happening right? have you ever read the points I have mentioned early? I began from the description of existing solutions and shown possible issues. If you want foolproof and simpl...