Getting the system profile

MisterX x at monsieurx.com
Thu Jul 10 17:36:00 EDT 2003


Shari, dear reticents... ;)

> The volumes on Windows only give the drive letters, A, B, C, etc. and
> do not even tell you which drive is being used for the CD.  Also, a
> user prompt is a big no no for this, must be done behind the scenes.

No user prompt required... dont worry...

bonus at the end...
but it'll be quite a full detailed email ...

Lets start...

> Also, if no CD is loaded, it spits up an error dialog, another no no.

I dont know where you saw this... I wonder, was it the net movie with
Sandra Bullock? ;))

Regardless of Windows versions, strictly in xtalk,
list the volumes:

  put the volumes into drivelist

Then repeat for each line driveletter
  put driveletter & "install\win32\myfile.win" into myfile
  get there is a file myfile then
  if not it then exit gracefuly

  if not parsesecurequantummultidimensionalcrc(url thefile) then
    explodePC -- pirates & industrial spys only
    exit gracefully
  end if

 I got my file, im happy, Icanrunnow, makemillionsformyuser

> cool on Mac.  But Windows is a bugger for this.  I thought I had it
> solved until I tested it on Windows last night, and discovered that
> my wondrous solution is not cross platform :-(

Windows is arcane technology but remember that unix is where shells
started and that's precompustoric and your new macosx is just not
"openly" showing it... It's dragging a zillion pounds mamooth GUI
on top of this shell... the shell's d fastest "online" thing there is...

also, dont complain about windows, lotus notes and vi are far worse
examples than miswindoze. It's just DOS. At work, I use MC to parse
these dos commands by the thousands weekly with an mc made button!

Getting the volume name is easy... DOS stuff in other words.
DOS has been around for longuer than even HyperTalk...
DOS is just another less-ugly-than-PERL language...

type 'help' in a dos window to find out more...

I tested this on Windows 98se & 2000
and follows is the basic features you must deal with:

get shell("vol" && driveletter)

C:\>vol f:
 Volume in drive X is XOS
 Volume Serial Number is E494-1388

or in a empty diskette cdrom drive:

C:\>vol v: = The device is not ready. -- my empty dvd drive

You must know that any Windows process can be done
behind the scenes and transparently. There wont even be
application switching. It can even be done in a background
process with at or as an NT service with full network/domain
access anywhere (NTResKit may be req.)

To hide the windows command use the hideconsole global.

This will completely hide the command/shell window. Remember
that Win95,98,se or, god-help-ya, winME use command.exe and
winNT (nt4,2k,xp)use cmd.exe. And linux, well... uh... sh?

So be careful about which version of windows is in use...
Just in case.

This you can find with:

get the platform

or better if it's win_something:

get shell("ver")

if you have the reskit, try:

get shell("srvinfo -ns servername") -- ma favorite
 -- includes shares and full drive info and spX and
and nics and cpus andandnandannanaaan

get shell("ipconfig /all") -- = network hw/sw config

and there's many many more... try www.sysinternals.com

Least but not last, make sure your "the directory" global
is pointing to a valid drive before using them (c: is a
great default.) Otherwise you get std cmd errors.

W98 "Invalid drive specification"
W2K "The system cannot find the drive specified."

Nonetheless, with the above, you
are armed to tackle all the eventuallities in windows. No
xcmds required, no user input, no shells in your face,
clean as a mac! On gross terms of course...

Oh yes... one last reminder: the line positions and even the
column positions of the output of these shell commands may
vary depending on different versions of these commands!

srvinfo in the occurence...

check EVERYTHING! MS programmed 'it'!

--

More thoughts out of context and none of my business...

Try an online registration (name+password exchange through mail...)
That's very effective... clean and pro...

I also sent you previously the link to the full API from
sysexternals just in case you really want that itty bit
of cdrom info that bad. You'll need a Visual C++ license
and lots more patience than with HC, MC and RR together
but it's the win32 way!

Best of lucks porting your apps across cultures my friends

Cheerios
Xavier

--

The only thing better than EOC is a Z3 M Coupe with quad neutron PBCs!
Great for caravan passing or people with high beams on...
Go wild at http://monsieurX.com

--

-- bonus scripts from XOS

on StartUp

    checkShellPlatform

---------------------
-- Shell Functions --
---------------------

on CheckWinShellPlatform
  if (the platform = "win32") and (word 1 of the systemversion is "windows")
then
    set the shellcommand to "command.com"
  else
    set the shellcommand to "cmd.exe"
  end if

  set the directory to "c:"

  -- Get OS info...
  put shell("ver") into os[version]
  put shell("ipconfig") into os[networkinfo]

  -- bonus pseudo scripts

  -- if nt + reskittest + user permission + + +
  if appexist(appname) and userisallowed(user,appname,options)
  then put shell(appname & appoptions) into os[moreinfo]

end CheckWinShellPlatform

 have fun!




More information about the metacard mailing list