Some program like UNIX 'file', but for Windows?

O

omega

Sietse Fliege said:
Hello Karen, :)

Hello Sietse !
Note #1: You can also simply have trid.exe (without PathToTrid)
Note #2: In case of one or more (seperate) spaces in path and/or file
name, the quotes around "%1" serve no purpose.
Better: trid.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
Note #3: In WinXP the console window closes.
One needs to have e.g. pause at the end.

So my trid.cmd (WinXP) reads:

-----trid.cmd-----
trid.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
pause
-------------------

Re: Note #3. Good that you included that difference, for NT/CMD users.
That which is reverse of 9X/command.com, where console window stays
open by default (except for extra bats invoked by CALL), and one needs
to explicitly set the properties in a pif, for close on exit, else have
launched from some external means (like with command /c).

Re: Note #2. This sounds like an important fundamental. I have used
the %1 %2 %3 %4 %5 %6 %7 %8 %9 in the past, when multiple arguments
were involved. It sounds like I ought well take the consistent habit
of that string. I can easily set it up in my tray clipboard utility
that I use for routine text. As to surrounding the %1 in quotes, I
right now have learnt what you mean. That it has no need. It is only
needed in certain other contexts, such as in setting up lnks and
explorer-menu commands, where some programs need the %1 in quotes.
Contexts separate from realm of bat/cmd files.

Re: Note #3. Looking that over, I must have appeared very silly. To
have something so redundant, the bat sitting in the folder with the
exe, and yet my having the full path to the exe in the path there.
I can only plead to be believed: I don't normally do that, and in
fact most all of my bats are "local."

On that situation, though, there is one issue that comes up for me.
I run things frequently via the drive/folder toolbars set up on the
startmenu. I cannot from there click on a bat to run it, since that
does not set me in its local path. It is a time like that where I
need an absolute path.

I have set up an explorer context menu for that situation, to be able
run my bats (specifically my pifs, those many I have that are also
local, without paths), when invoking them from theo startmenu drives
toolbars. When I set it up, it was kind of a tricky subject for me.
I finally had to resort to a hack, where an accompanying action is
that an instance of explorer is opened up in that folder, and it's
that act which changes path so that the pif/bat knows where to run from.
The circumstance where I use these, I happen to actually prefer most
times getting the explorer window. However, it is also true that I knew
no other way to get this done.

The paragraph above is pretty elliptical, might be totally incoherent.
At the point where I commit to getting help on that situation, I'll need
to rewrite my question slowly. And I suppose I'd have to post it in a
batch groups, something I'm inclined to continue procrastinating.
 
O

omega

omega said:
"Sietse Fliege" <[email protected]>:
Note #1: You can also simply have trid.exe (without PathToTrid)
[...]
Re: Note #3. Looking that over, I must have appeared very silly. To
have something so redundant, the bat sitting in the folder with the
exe, and yet my having the full path to the exe in the path there.
I can only plead to be believed: I don't normally do that, and in
fact most all of my bats are "local."

I meant...re Note #1 above.

That's what I get for not using an interleaved reply, and expecting
I could manage to keep track of three things all at once. :?o
 
S

Susan Bugher

omega said:
Re: Note #3. Looking that over, I must have appeared very silly. To
have something so redundant, the bat sitting in the folder with the
exe, and yet my having the full path to the exe in the path there.
I can only plead to be believed: I don't normally do that, and in
fact most all of my bats are "local."

True confessions time. I wish I'd done it your way. The reason I
couldn't get TrID to work when I first tried it: I created a local .bat
file - then dragged it out on the desktop for "convenience".

What can I say? It was late - I was tired - I hadn't written a .bat file
in ages - etc. etc. etc. ;)

Susan
 
B

Bjorn Simonsen

Susan Bugher wrote in said:
True confessions time. I wish I'd done it your way. The reason I
couldn't get TrID to work when I first tried it: I created a local .bat
file - then dragged it out on the desktop for "convenience".

What can I say? It was late - I was tired - I hadn't written a .bat file
in ages - etc. etc. etc. ;)

I know what you mean. The other day I dragged an icon right off my
screen so it landed in my coffee mug. It still works though, but it is
kind of awkward having to dobbel-click my left kidney to launch my
favorite editor. Oh well.

All the best
Bjorn Simonsen
 
O

omega

Bjorn Simonsen said:
I know what you mean. The other day I dragged an icon right off my
screen so it landed in my coffee mug. It still works though, but it is
kind of awkward having to dobbel-click my left kidney to launch my
favorite editor. Oh well.

That is true art. I'm saving forever.
 
S

Susan Bugher

Bjorn said:
I know what you mean. The other day I dragged an icon right off my
screen so it landed in my coffee mug. It still works though, but it is
kind of awkward having to dobbel-click my left kidney to launch my
favorite editor. Oh well.

I wish you hadn't posted that. :) :) :) It made me to hunt this info
down (you might need it eventually):

Most contemporary icons are produced with great care and attention to
detail. However, being subjected to repeated clicking and constant
bombardment by cathode rays, they tend to deteriorate over time.

In order to maintain their graphic integrity, it is recommended that the
following procedure be followed at least once every six months:

1. Remove the icon from the monitor, being careful to handle it only by
the edges to avoid pixel damage.

2. Soak in a lukewarm, soapy solution for 5 to 10 minutes. Do not rub or
scrub, or pixels may be shifted, resulting in serious disintegration of
the image.

3. Remove from bath and stand on edge to dry. Under no circumstance
attempt to dry with a rag or lens tissue, and never subject to
blow-drying, or permanent damage may result. If more than 5% of the
pixels have been lost, replace icon with a new one.

4. Carefully replace cleaned icon in monitor, taking special care not to
touch the surface.

5. Allow to set one hour before using. If icons need to be exchanged
from one computer to another, they should be transported only in
specially prepared icon cases available at any computer or electronic
supply store.

Remember, icons are the heart and soul of the Windows environment, and
should be treated accordingly.

Susan
 
S

Sietse Fliege

omega said:
I meant...re Note #1 above.

That's what I get for not using an interleaved reply, and expecting
I could manage to keep track of three things all at once. :?o

LOL Thanks for the correction, btw.
 
S

Sietse Fliege

omega said:
The paragraph above is pretty elliptical, might be totally incoherent.
At the point where I commit to getting help on that situation, I'll
need to rewrite my question slowly.

I'm not savvy enough to completely understand the issues without you
providing a more concrete example.
And I suppose I'd have to post it in a batch groups,

I guess it would be better, also in order to get the best answer.
something I'm inclined to continue procrastinating.

Hey, my middle name is Procrastinator. :)
 
B

Bjorn Simonsen

Susan Bugher wrote in said:
I wish you hadn't posted that. :) :) :) It made me to hunt this info
down (you might need it eventually):

Most contemporary icons are produced with great care and attention to
detail. However, being subjected to repeated clicking and constant
bombardment by cathode rays, they tend to deteriorate over time.
[...]

Thanks, filed it under Organize:Humor;computer,GUI;Icon. (heh heh)
:):)

All the best,
Bjorn Simonsen
 
S

Sietse Fliege

omega said:
On that situation, though, there is one issue that comes up for me.
I run things frequently via the drive/folder toolbars set up on the
startmenu. I cannot from there click on a bat to run it, since that
does not set me in its local path. It is a time like that where I
need an absolute path.

I have set up an explorer context menu for that situation, to be able
run my bats (specifically my pifs, those many I have that are also
local, without paths), when invoking them from theo startmenu drives
toolbars. When I set it up, it was kind of a tricky subject for me.
I finally had to resort to a hack, where an accompanying action is
that an instance of explorer is opened up in that folder, and it's
that act which changes path so that the pif/bat knows where to run
from. The circumstance where I use these, I happen to actually prefer
most times getting the explorer window. However, it is also true that
I knew no other way to get this done.

I'm not at all sure that I understand, but I'll have a go, nonetheless:

Suppose you have a batch, say: DoIt.bat, stored somewhere.
You have a shortcut to DoIt.bat, say: somewhere in the Start Menu.
(Left-) clicking that would run DoIt.bat, but without you being able to:
a) - start it in a newly selected folder and/or
b) - run it with newly added arguments

Provided that, from where you run the shortcut, you have access to a
context-menu for it, a solution could be to have some context menu item
or a SendTo item, that lets you do a) and/or b).

For instance, NirSoft's NirExt lets you install an "Advanced Run"
context menu item. (It lets you also optionally install two other shell
extensions. b.t.w.)
The "Advanced Run" context menu item lets you do both a) and b).

However, you have to manually type in the start-in folder (or paste it).
It does not let you select it in a folder dialog (nor does it provide
for history or favorites).

For the folder selection I have a work around:
I wrote a (very simple!) AutoIt script and compiled it to StartIn.exe.
(See also below, Note #3)
StartIn.exe lets me select a folder in a standard Windows (small, but
otherwise fine) folder selection dialog (like you e.g. often see in
install programs) and saves the resulting folder name to the clipboard.
I made a shortcut to StartIn.exe, providing for an associated hotkey.

To sum it up: If I want to start my DoIt.bat, I then:
+ right-click the DoIt shortcut (e.g. in my Start Menu)
+ select NirExt's "Advanced Run" from the context menu
+ maybe paste something from the clipboard as an argument in the dialog
+ hit Win+S = the hotkey that I have associated with my StartIn shortcut
+ select a start-in folder within StartIn's folder dialog that pops up
+ paste the resulting folder name from the clipboard into NirExt's
"Advanced Run" dialog

Note #1: there is one caveat about NirExt:
It registers the Advanced Run shell extension only for exe files.
You have to manually hack the registry to register it for bat/cmd files.
A piece of cake for you, Karen, but anyone who is reading this and who
is interested but can't figure it out should just let know.
(I believe there are also alternatives for NirExt, though.)

Note #2: There is probably a smarter way to use AutoIt's folder dialog
feature. One that, either as a context menu item or as a SendTo item,
would let you bypass NirExt and the clipboard.
I did first try that, but found it to be tricky and did not succeed.
I may be trying more.

Note #3: The script for StartIn.exe was very simple indeed:

-----------------------StartIn.au3-----------------------
$StartInFolder = FileSelectFolder("Start in Folder:", "")
ClipPut ($StartInFolder)
---------------------------------------------------------

In order to run the script (StartIn.au3) or to compile it, one needs to
install AutoIt v3.
But the compiled StartIn.exe can be run by anyone, without AutoIt.
I will try to upload StartIn.exe to alt.binaries.freeware.

I may have mistunderstood you, Karen, or you may find this method too
clunky, but anyway:

HTH
 
S

Sietse Fliege

O

omega

Sietse Fliege said:
Sietse said:
For instance, NirSoft's NirExt lets you install an "Advanced Run"
context menu item. (It lets you also optionally install two other
shell extensions. b.t.w.)

http://www.nirsoft.net/utils/nirext.html [38KB]

But the compiled StartIn.exe can be run by anyone, without AutoIt.
I will try to upload StartIn.exe to alt.binaries.freeware.

Instead you can download it here:
http://s2.yousendit.com/d.aspx?id=00E430B7CB9AD98CC0D297BA9DBEBE8A

I'm going to download it shortly, as it looks like fun.

The particular config of mine that I was making elliptical reference to,
it is actually pretty much okay. I mean all I have to do is a single click,
and then my local pifs run fine. I plan to take a couple of screenshots
and upload in order to explain my situation.

Now that I think about it some more, too, since it is local pifs
specifically, not batch files, which I am dealing with, might not be
much to do from there. (Sorry: what I said won't make sense until I
explain my system configuration.)

What would be useful is to go into the related subject: writing a batch
file, one that shall be used contextually (from sendto or from explorer
context menu), which can retrieve the path of the targeted object and do
CD to that locale for its actions. (Might be impossible from the toolbar
launching, but at least one can get it set up for launching from a file-
manager context.) I once poked around with some batch utilities towards
this end, but had not persisted with the project long enough to get things
properly worked out. And since it is such a fundamental need, have since
then felt a bit incompetent.

Give me some hours before I get back on any of these subjects. I'll take
my screenshots, and read about your new toy, and so on, first. And at hand
I've got a couple of things here also that are requiring disconnect for
a little bit. Thanks, Sietse...
 
O

omega

What would be useful is to go into the related subject: writing a batch
file, one that shall be used contextually (from sendto or from explorer
context menu)

Minor correction. I've noted no problem with simple explorer context menu
things. It is more esecially with sendto where I've sometimes stumbled.
An example: InnoUnp. I'd no problem putting that in explorer context-menu,
but writing a batch file for sendto that did a proper CD for the active
directory as output, felt like a dope, but fact was I didn't know how to
handle that.
 
O

omega

Sietse Fliege said:
I'm not at all sure that I understand,

One main part of this, it involves a fairly specific situation of mine.
I'll need to spend some space really explaining what I have going on.
It is not very important in itself, and probably it'd be more productive
that I move into more normal and general situations; but let me please
permit that I get this out of the way first.

Program folders on my system all have a template pattern. At the root of
each is a local run.pif file. There are two variations of run.pif files.
One that points directly to the executable in the BIN directory (used
with green programs). Or the other type, it points to a subdirectory,
named XREG, to a bat in that folder. (That second config is for programs
I run dynamically, where eg registry entries are loaded before execute,
and deleted on exit.)

I should note. The situation that I am specifically describing here, it
is for GUI programs. CLI programs are independent of this config.

ProgFolder1\
pif.run
BIN\prognameA.exe

ProgFolder2\
pif.run
BIN\prognameB.exe
XREG\run.bat

(screenshot illustration http://omega5.port5.com/clips/0925/DirLayout.png )

The pifs are local, no absolute paths. (The first type, the run.pif
properties has for Cmd: "BIN\SomeName.exe." The second type, the pif
properties has for Cmd: "XREG\RUN.bat.")

If I'm working from a file manager, then I can launch these local pifs.
Yet I often launch things from the toolbar(s) on my startbar. In that
action, the run.pif doesn't know where it is. So I had to write a special
bat for an explorer context-menu action. In this bat, an explorer window
is opened, and that has the effect of setting the working folder at my
target.

---PifRun.bat------
explorer /e,/root,"%1"
cd %1
start run.pif
-------------------

Regarding the first line. The truncated rooted view, that is just a
whimsical preference. Seconly, as to whether a different file manager
could be equally used to the same effect, well, I've not tested. I'd
guess probably so. Not need to test, as I do happen to be a deliberate
user of the explorer as my primary.

Regarding the second line. Until very recently, it read: cd "%1" (with
the quotes). ;)

As I said, I tend to want to get the program's folder opened at the same
time as the program launch, some ~majority of time. So I am not malcontent
here. I'd mainly brought it up as an example of a situation where I could
not get local pifs to launch. That if it was the case I did -not- want that
extra explorer window opened, I would not know how to write a batch that
would have the effect I need in this particular situation of mine.

(Btw, here is a brief visual description of what I was trying to describe:
http://omega5.port5.com/clips/0925/index.htm )

What I've put forth there, I now am thinking best to largely ignore, that
it'd be far better instead to address more normal examples...

.. . . .

Now, here is a more standard situation. Some CLI programs. Let me talk
about a type of case that doesn't even bring in the extra complexity of
configuring sendto bats. It's where I just want to run some CLI program
straight out, from a simple bat written for it containing particular
parameters that I've chosen. xBAR was a recent example for me. It has
a variety of disparate actions it can do. In its folder, I put separate
bats for each set of actions I might want to have executed.

But I cannot launch those bats from my toolbar.

It would be nice if I knew what contextual command could be configured
for this sort of targeted object, where there would be a CD to that
object's path, so that it would be able to run.
but I'll have a go, nonetheless:

Suppose you have a batch, say: DoIt.bat, stored somewhere.
You have a shortcut to DoIt.bat, say: somewhere in the Start Menu.
(Left-) clicking that would run DoIt.bat, but without you being able to:
a) - start it in a newly selected folder and/or
b) - run it with newly added arguments

Consequence of my having been incoherent in my earlier message. I was not
after these things. I was after strictly a single-click-launch. (Something
that auto-changes active directory, for an action, to that of the targeted
object). I was not after dynamic new choices at run...

Not for the area of need I'd been hinting about. A different matter is
whether I am greedy, and will find uses for your toy in other situations.
Darn likely, that. :)

[...]
StartIn.exe lets me select a folder in a standard Windows (small, but
otherwise fine) folder selection dialog (like you e.g. often see in
install programs) and saves the resulting folder name to the clipboard.
I made a shortcut to StartIn.exe, providing for an associated hotkey.

To sum it up: If I want to start my DoIt.bat, I then:
+ right-click the DoIt shortcut (e.g. in my Start Menu)
+ select NirExt's "Advanced Run" from the context menu
+ maybe paste something from the clipboard as an argument in the dialog
+ hit Win+S = the hotkey that I have associated with my StartIn shortcut
+ select a start-in folder within StartIn's folder dialog that pops up
+ paste the resulting folder name from the clipboard into NirExt's
"Advanced Run" dialog

I think I will make a point of taking a test drive with this directly
for one need I've had for a while. It concerns the hassle of using HelpDeco.
(HelpDeco is a CLI prog for decompiling .HLP files.)

I have a rather unsatisfactory batch that I use with it. Unsatisfactory
because my bat lamely can only decompile the target into a preset path.
I've long wanted to resolve a better way to deal with HelpDeco decompiles.
Your StartIn sounds like it might be just the ticket for solving that
problem.

Thank you, Sietse...
 
O

omega

Bjorn Simonsen said:
Susan Bugher wrote in said:
I wish you hadn't posted that. :) :) :) It made me to hunt this info
down (you might need it eventually):

Most contemporary icons are produced with great care and attention to
detail. However, being subjected to repeated clicking and constant
bombardment by cathode rays, they tend to deteriorate over time.
[...]

Thanks, filed it under Organize:Humor;computer,GUI;Icon. (heh heh)
:):)

If I ever get back to teaching "intro to computers," I could use it
as a first day hand-out, for the students to study. The students
I used to get (good-hearted seniors), they were very vulnerable at
that stage, and they believed every word one uttered.

(Nah...I wouldn't really be so sadistic.)
 
S

Susan Bugher

omega said:
Bjorn Simonsen <[email protected]>:


If I ever get back to teaching "intro to computers," I could use it
as a first day hand-out, for the students to study. The students
I used to get (good-hearted seniors), they were very vulnerable at
that stage, and they believed every word one uttered.

(Nah...I wouldn't really be so sadistic.)

maybe a few from this list. . . ;)

http://community.shwing.com/forum/archive/index.php/t-113.html

Care And Feeding Of Your Computer

I've been working on a project at work to ensure all our end users know
how to back up data in preparation for company wide computer upgrades.
I'm tempted to hand this out to some of our users.

1. Never leave diskettes in the disk drive, as data can leak out of the
disk and corrode the inner mechanics of the drive. Diskettes should be
rolled up and stored in pencil holders.

2. Diskettes should be cleaned and waxed once a week. Microscopic metal
particles can be removed by waving a powerful magnet over the surface of
the disk. Any stubborn metallic shavings can be removed with scouring
powder and soap. When waxing diskettes, make sure application is even.
This will allow the diskettes to spin faster, resulting in better access
time.

3. Do not fold diskettes unless they do not fit in the drive. "Big"
diskettes may be folded and used in "little" disk drives.

4. Never insert a disk into the drive upside down. The data can fall off
the surface of the disk and jam the intricate mechanics of the drive.

5. Diskettes cannot be backed up by running them through the Xerox
machine. If your data needs to be backed up, simply insert two diskettes
together into the drive whenever you update a document; the data will be
recorded on both diskettes.

6. Diskettes should not be inserted into or removed from the drive while
the red light is flashing. Doing so could result in smeared or possibly
unreadable text. Occasionally the red light continues to flash in what
is known as a "hung" or "hooked" state. If your system is "hooking" you,
you will probably need to insert several dollars before being allowed to
access the disk drive.

7. If your diskette is full and you need more storage space, remove the
disk from the drive and shake vigorously for two minutes. This will pack
the data ("data compression") enough to allow for more storage. Be sure
to cover all the openings with scotch tape to prevent loss of data.

Susan
 
O

omega

Susan Bugher said:
If I ever get back to teaching "intro to computers," I could use it
as a first day hand-out, for the students to study. The students
I used to get (good-hearted seniors), they were very vulnerable at
that stage, and they believed every word one uttered.

(Nah...I wouldn't really be so sadistic.)

maybe a few from this list. . . ;)

http://community.shwing.com/forum/archive/index.php/t-113.html

Care And Feeding Of Your Computer
[...]
7. If your diskette is full and you need more storage space, remove the
disk from the drive and shake vigorously for two minutes. This will pack
the data ("data compression") enough to allow for more storage. Be sure
to cover all the openings with scotch tape to prevent loss of data.

I'd better pass. They might believe the whole thing! And I've already an
overflowing surplus of units stashed up in my cumulative-sins account.
 
M

Mike Henley


I installed cygwin a few times in the past; installation was easy,
only thing was, i couldn't find tutorials on how to use it once it was
installed. Does anyone know any tutorials on how a lifetime windows
user can use cygwin after installation?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top