Search found 174 matches

by siberia-man
09 Nov 2014 08:24
Forum: DOS Batch Forum
Topic: js/vbs/html/hta and more hybrids and chimeras in cmd/bat
Replies: 61
Views: 174683

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

The post viewtopic.php?p=37780#p37780 was updated.

Now the script is able to produce working wrapper for powershell script. Now the hybrid is able to read stdin on the same way as the original powershell script.
by siberia-man
08 Nov 2014 10:40
Forum: DOS Batch Forum
Topic: Detect redirection and EOF in Standard Handles
Replies: 3
Views: 8438

Re: Detect redirection and EOF in Standard Handles

Seems there is no internal way to detect if a handler is redirected to a file or another pipe. With this idea as base, I wrote a very small and simple .COM program that allows to detect if a standard handle has been redirected to a disk file Aacini , what if you share the original assembler code of ...
by siberia-man
06 Nov 2014 01:40
Forum: DOS Batch Forum
Topic: js/vbs/html/hta and more hybrids and chimeras in cmd/bat
Replies: 61
Views: 174683

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

fixes and improvements to the code above. The message was updated. Feature list: -- It does comment on "Option Explicit" in VBScript. -- "<?xml?>" declaration for wsf-files is expected. -- "Option Explicit" and "<?xml?>" in a single line only are supported. --...
by siberia-man
04 Nov 2014 06:16
Forum: DOS Batch Forum
Topic: Powershell2/bat hybrid?
Replies: 25
Views: 45606

Re: Powershell2/bat hybrid?

Yep. Seems there are no better ways to hybridize cmd and powershell (or embed powershell into a batch file). Anyway this solution keeps ability for piping and allows using of command lines arguments through $args (I guess this is standard variable in powershell).
by siberia-man
03 Nov 2014 21:01
Forum: DOS Batch Forum
Topic: js/vbs/html/hta and more hybrids and chimeras in cmd/bat
Replies: 61
Views: 174683

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

bars143 You are right. The script produces non-working script when the original vbs-file has "Option Explicit". I found it, as well, when I asked myself "what if I code using this directive?" I have modified the "cmdize" script but the solution is so ugly and so funny....
by siberia-man
03 Nov 2014 17:02
Forum: DOS Batch Forum
Topic: Powershell2/bat hybrid?
Replies: 25
Views: 45606

Re: Powershell2/bat hybrid?

Found few hours ago: blogs.msdn.com/b/jaybaz_ms/archive/2007/04/26/powershell-polyglot.aspx stackoverflow.com/a/2611487/3627676 In my opinions this solution is the best of known. Also you can find my attempt to compile all available solutions in one script. See this thread: http://www.dostips.com/fo...
by siberia-man
03 Nov 2014 17:00
Forum: DOS Batch Forum
Topic: js/vbs/html/hta and more hybrids and chimeras in cmd/bat
Replies: 61
Views: 174683

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

I decided come back to this thread attempting to cover most of issues in one solution =) I spent few minutes thinking how to name the script. There were three possible candidates: -- any2bat or every2bat (similar to pl2bat or js2bat, but "any" or "every" don't cover everything) -...
by siberia-man
21 Oct 2014 11:00
Forum: DOS Batch Forum
Topic: robust line counter
Replies: 22
Views: 14591

Re: robust line counter

Sponge Belly
Agree with you. "more" has much more problems with huge lines. I remember once I have had inadequate behavior with lines over 64K characters.
by siberia-man
20 Oct 2014 12:36
Forum: DOS Batch Forum
Topic: robust line counter
Replies: 22
Views: 14591

Re: robust line counter

Code: Select all

more FILENAME | find /c /v ""


this works, as well
by siberia-man
17 Oct 2014 00:29
Forum: DOS Batch Forum
Topic: doskey /history doesn't work properly after doskey reinstall
Replies: 3
Views: 2540

Re: doskey /history doesn't work properly after doskey reins

Aacini, thank you. Probably this is the most robust solution to clear history and keep the functionality:

Code: Select all

doskey /listsize=0
doskey /listsize=50

where the default value 50 can be replaced by another value as requested.
by siberia-man
16 Oct 2014 13:15
Forum: DOS Batch Forum
Topic: doskey /history doesn't work properly after doskey reinstall
Replies: 3
Views: 2540

doskey /history doesn't work properly after doskey reinstall

I am not sure if this is specific for my computer. Can some one test it and confirm? The test is very simple. 1. open command prompt 2. execute few commands 3. check the command history by the command doskey /history 4. clear the history list doskey /reinstall 5. repeat the item 2 (arbitrary command...
by siberia-man
31 May 2014 11:57
Forum: DOS Batch Forum
Topic: Conditionals on steroids
Replies: 0
Views: 4464

Conditionals on steroids

I decided to share my little work that extends conditionals in batch scripts. I developed it just for fun. And I can say that the time I spent for it gave me some pleasure :). I put here the link to the source (not for advertisements but for those people who could be interested to read more). https:...
by siberia-man
14 May 2014 18:07
Forum: DOS Batch Forum
Topic: create dummy files of exact size
Replies: 15
Views: 10821

Re: create dummy files of exact size

One more good solution inspired by this response m powershell -c "$f = New-Object System.IO.FileStream '.\filename.txt', Create, ReadWrite; $f.SetLength(4GB); $f.Close()" As the bonus it allows to define the file size as a number or in symbolic form (as 4GB for 4 gigabytes in the example a...
by siberia-man
06 May 2014 01:02
Forum: DOS Batch Forum
Topic: A batch file to get IP location
Replies: 1
Views: 2311

Re: A batch file to get IP location

Thereis the best (in my opinion) place to know about yourself -- ifconfig.me. I don't have any relationship with the site I am just its user. Loook at this page as well with-love-from-siberia.blogspot.com/2012/03/universal-way-to-identify-your-external.html Dim xmlhttp, ip Set xmlhttp = CreateObject...
by siberia-man
23 Apr 2014 00:47
Forum: DOS Batch Forum
Topic: js/vbs/html/hta and more hybrids and chimeras in cmd/bat
Replies: 61
Views: 174683

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

"%~f0?.wsf" Very interesting trick allowing to run a batch file as wsf scenario. I tried to embed wsf into bat/cmd but all my attempts bumped to impossibility to run bat file as wsf (as it is possible for vbs or js scenarios). Is there source where I could learn more about it? Seems it us...