PC Review


Reply
Thread Tools Rate Thread

How to check Operating System?

 
 
NateBuckley
Guest
Posts: n/a
 
      11th Aug 2008
Hello I've been using WinAPI calls to do some swanky stuff, but although no
one uses Macs where I work, I'd like (if possible) to aquire the operating
system information so IF Mac then don't do WinAPI calls etc. Not really an
issue at the moment but always good to know just in case.

Is this possible with VBA?

Cheers!
 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      11th Aug 2008
Maybe

opsystem = Environ(13)

Mike

"NateBuckley" wrote:

> Hello I've been using WinAPI calls to do some swanky stuff, but although no
> one uses Macs where I work, I'd like (if possible) to aquire the operating
> system information so IF Mac then don't do WinAPI calls etc. Not really an
> issue at the moment but always good to know just in case.
>
> Is this possible with VBA?
>
> Cheers!

 
Reply With Quote
 
NateBuckley
Guest
Posts: n/a
 
      11th Aug 2008
Thank you sir! Went through the numbers and was 12 that told me the OS.
Taking it this wouldn't work on a Mac? So Guess just do a test to see if that
call fails, if so goto label then change a bool or something.

Thanks matey!

"Mike H" wrote:

> Maybe
>
> opsystem = Environ(13)
>
> Mike
>
> "NateBuckley" wrote:
>
> > Hello I've been using WinAPI calls to do some swanky stuff, but although no
> > one uses Macs where I work, I'd like (if possible) to aquire the operating
> > system information so IF Mac then don't do WinAPI calls etc. Not really an
> > issue at the moment but always good to know just in case.
> >
> > Is this possible with VBA?
> >
> > Cheers!

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      11th Aug 2008
#If Mac Then
' it's a Mac
#Else
' it's not a Mac
#End If

Regards,
Peter T

"NateBuckley" <(E-Mail Removed)> wrote in message
news:1506E2B1-FBC0-44F5-8E8B-(E-Mail Removed)...
> Hello I've been using WinAPI calls to do some swanky stuff, but although
> no
> one uses Macs where I work, I'd like (if possible) to aquire the operating
> system information so IF Mac then don't do WinAPI calls etc. Not really an
> issue at the moment but always good to know just in case.
>
> Is this possible with VBA?
>
> Cheers!



 
Reply With Quote
 
NateBuckley
Guest
Posts: n/a
 
      11th Aug 2008
Thank you very much, just what I wanted.

Your a star.

If you have the time may I ask what # means? I shall go and attempt to find
out what they mean from google.

Thanks again

"Peter T" wrote:

> #If Mac Then
> ' it's a Mac
> #Else
> ' it's not a Mac
> #End If
>
> Regards,
> Peter T
>
> "NateBuckley" <(E-Mail Removed)> wrote in message
> news:1506E2B1-FBC0-44F5-8E8B-(E-Mail Removed)...
> > Hello I've been using WinAPI calls to do some swanky stuff, but although
> > no
> > one uses Macs where I work, I'd like (if possible) to aquire the operating
> > system information so IF Mac then don't do WinAPI calls etc. Not really an
> > issue at the moment but always good to know just in case.
> >
> > Is this possible with VBA?
> >
> > Cheers!

>
>
>

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      11th Aug 2008
Search "compile" and/or "conditional compilation" in VBA help

Regards,
Peter T


"NateBuckley" <(E-Mail Removed)> wrote in message
news:FDC8036E-475F-4A83-BF84-(E-Mail Removed)...
> Thank you very much, just what I wanted.
>
> Your a star.
>
> If you have the time may I ask what # means? I shall go and attempt to
> find
> out what they mean from google.
>
> Thanks again
>
> "Peter T" wrote:
>
>> #If Mac Then
>> ' it's a Mac
>> #Else
>> ' it's not a Mac
>> #End If
>>
>> Regards,
>> Peter T
>>
>> "NateBuckley" <(E-Mail Removed)> wrote in message
>> news:1506E2B1-FBC0-44F5-8E8B-(E-Mail Removed)...
>> > Hello I've been using WinAPI calls to do some swanky stuff, but
>> > although
>> > no
>> > one uses Macs where I work, I'd like (if possible) to aquire the
>> > operating
>> > system information so IF Mac then don't do WinAPI calls etc. Not really
>> > an
>> > issue at the moment but always good to know just in case.
>> >
>> > Is this possible with VBA?
>> >
>> > Cheers!

>>
>>
>>



 
Reply With Quote
 
Gary Keramidas
Guest
Posts: n/a
 
      11th Aug 2008
you can try this:
environ("OS")

or, somebody wrote this, can't remember who, though:

Sub ListEnvioron()
Dim Rng As Range
Dim Ndx As Long
Dim S As String
Dim Pos As Long

Ndx = 1
On Error Resume Next
Set Rng = Range("A1")
Do While True
S = Environ(Ndx)
If Err.Number <> 0 Then
Exit Do
End If
Pos = InStr(1, S, "=")
Rng.Value = Left(S, Pos - 1)
Rng(1, 2).Value = Mid(S, Pos + 1)
Ndx = Ndx + 1
Set Rng = Rng(2, 1)
Loop
End Sub

--


Gary


"Peter T" <peter_t@discussions> wrote in message
news:exCGEF7%(E-Mail Removed)...
> Search "compile" and/or "conditional compilation" in VBA help
>
> Regards,
> Peter T
>
>
> "NateBuckley" <(E-Mail Removed)> wrote in message
> news:FDC8036E-475F-4A83-BF84-(E-Mail Removed)...
>> Thank you very much, just what I wanted.
>>
>> Your a star.
>>
>> If you have the time may I ask what # means? I shall go and attempt to find
>> out what they mean from google.
>>
>> Thanks again
>>
>> "Peter T" wrote:
>>
>>> #If Mac Then
>>> ' it's a Mac
>>> #Else
>>> ' it's not a Mac
>>> #End If
>>>
>>> Regards,
>>> Peter T
>>>
>>> "NateBuckley" <(E-Mail Removed)> wrote in message
>>> news:1506E2B1-FBC0-44F5-8E8B-(E-Mail Removed)...
>>> > Hello I've been using WinAPI calls to do some swanky stuff, but although
>>> > no
>>> > one uses Macs where I work, I'd like (if possible) to aquire the operating
>>> > system information so IF Mac then don't do WinAPI calls etc. Not really an
>>> > issue at the moment but always good to know just in case.
>>> >
>>> > Is this possible with VBA?
>>> >
>>> > Cheers!
>>>
>>>
>>>

>
>



 
Reply With Quote
 
Jim Rech
Guest
Posts: n/a
 
      11th Aug 2008
And don't forget: Application.OperatingSystem

--
Jim
"Gary Keramidas" <GKeramidasATmsn.com> wrote in message
news:eS%238Ph7%(E-Mail Removed)...
| you can try this:
| environ("OS")
|
| or, somebody wrote this, can't remember who, though:
|
| Sub ListEnvioron()
| Dim Rng As Range
| Dim Ndx As Long
| Dim S As String
| Dim Pos As Long
|
| Ndx = 1
| On Error Resume Next
| Set Rng = Range("A1")
| Do While True
| S = Environ(Ndx)
| If Err.Number <> 0 Then
| Exit Do
| End If
| Pos = InStr(1, S, "=")
| Rng.Value = Left(S, Pos - 1)
| Rng(1, 2).Value = Mid(S, Pos + 1)
| Ndx = Ndx + 1
| Set Rng = Rng(2, 1)
| Loop
| End Sub
|
| --
|
|
| Gary
|
|
| "Peter T" <peter_t@discussions> wrote in message
| news:exCGEF7%(E-Mail Removed)...
| > Search "compile" and/or "conditional compilation" in VBA help
| >
| > Regards,
| > Peter T
| >
| >
| > "NateBuckley" <(E-Mail Removed)> wrote in message
| > news:FDC8036E-475F-4A83-BF84-(E-Mail Removed)...
| >> Thank you very much, just what I wanted.
| >>
| >> Your a star.
| >>
| >> If you have the time may I ask what # means? I shall go and attempt to
find
| >> out what they mean from google.
| >>
| >> Thanks again
| >>
| >> "Peter T" wrote:
| >>
| >>> #If Mac Then
| >>> ' it's a Mac
| >>> #Else
| >>> ' it's not a Mac
| >>> #End If
| >>>
| >>> Regards,
| >>> Peter T
| >>>
| >>> "NateBuckley" <(E-Mail Removed)> wrote in message
| >>> news:1506E2B1-FBC0-44F5-8E8B-(E-Mail Removed)...
| >>> > Hello I've been using WinAPI calls to do some swanky stuff, but
although
| >>> > no
| >>> > one uses Macs where I work, I'd like (if possible) to aquire the
operating
| >>> > system information so IF Mac then don't do WinAPI calls etc. Not
really an
| >>> > issue at the moment but always good to know just in case.
| >>> >
| >>> > Is this possible with VBA?
| >>> >
| >>> > Cheers!
| >>>
| >>>
| >>>
| >
| >
|
|


 
Reply With Quote
 
Gary Keramidas
Guest
Posts: n/a
 
      11th Aug 2008
yep, that's another one, thanks, jim.

--


Gary


"Jim Rech" <(E-Mail Removed)> wrote in message
news:eBZ1Jn7%(E-Mail Removed)...
> And don't forget: Application.OperatingSystem
>
> --
> Jim
> "Gary Keramidas" <GKeramidasATmsn.com> wrote in message
> news:eS%238Ph7%(E-Mail Removed)...
> | you can try this:
> | environ("OS")
> |
> | or, somebody wrote this, can't remember who, though:
> |
> | Sub ListEnvioron()
> | Dim Rng As Range
> | Dim Ndx As Long
> | Dim S As String
> | Dim Pos As Long
> |
> | Ndx = 1
> | On Error Resume Next
> | Set Rng = Range("A1")
> | Do While True
> | S = Environ(Ndx)
> | If Err.Number <> 0 Then
> | Exit Do
> | End If
> | Pos = InStr(1, S, "=")
> | Rng.Value = Left(S, Pos - 1)
> | Rng(1, 2).Value = Mid(S, Pos + 1)
> | Ndx = Ndx + 1
> | Set Rng = Rng(2, 1)
> | Loop
> | End Sub
> |
> | --
> |
> |
> | Gary
> |
> |
> | "Peter T" <peter_t@discussions> wrote in message
> | news:exCGEF7%(E-Mail Removed)...
> | > Search "compile" and/or "conditional compilation" in VBA help
> | >
> | > Regards,
> | > Peter T
> | >
> | >
> | > "NateBuckley" <(E-Mail Removed)> wrote in message
> | > news:FDC8036E-475F-4A83-BF84-(E-Mail Removed)...
> | >> Thank you very much, just what I wanted.
> | >>
> | >> Your a star.
> | >>
> | >> If you have the time may I ask what # means? I shall go and attempt to
> find
> | >> out what they mean from google.
> | >>
> | >> Thanks again
> | >>
> | >> "Peter T" wrote:
> | >>
> | >>> #If Mac Then
> | >>> ' it's a Mac
> | >>> #Else
> | >>> ' it's not a Mac
> | >>> #End If
> | >>>
> | >>> Regards,
> | >>> Peter T
> | >>>
> | >>> "NateBuckley" <(E-Mail Removed)> wrote in message
> | >>> news:1506E2B1-FBC0-44F5-8E8B-(E-Mail Removed)...
> | >>> > Hello I've been using WinAPI calls to do some swanky stuff, but
> although
> | >>> > no
> | >>> > one uses Macs where I work, I'd like (if possible) to aquire the
> operating
> | >>> > system information so IF Mac then don't do WinAPI calls etc. Not
> really an
> | >>> > issue at the moment but always good to know just in case.
> | >>> >
> | >>> > Is this possible with VBA?
> | >>> >
> | >>> > Cheers!
> | >>>
> | >>>
> | >>>
> | >
> | >
> |
> |
>
>



 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      11th Aug 2008
Gary, unfortunately, depending on the system (incl some Windows), you cannot
rely on environ("OS") to return anything at all.

Mike H, opsystem = Environ(13)
that "OS" relates to 13 is purely specific to your own machine

Regards,
Peter T

"Gary Keramidas" <GKeramidasATmsn.com> wrote in message
news:eS%238Ph7%(E-Mail Removed)...
> you can try this:
> environ("OS")
>
> or, somebody wrote this, can't remember who, though:
>
> Sub ListEnvioron()
> Dim Rng As Range
> Dim Ndx As Long
> Dim S As String
> Dim Pos As Long
>
> Ndx = 1
> On Error Resume Next
> Set Rng = Range("A1")
> Do While True
> S = Environ(Ndx)
> If Err.Number <> 0 Then
> Exit Do
> End If
> Pos = InStr(1, S, "=")
> Rng.Value = Left(S, Pos - 1)
> Rng(1, 2).Value = Mid(S, Pos + 1)
> Ndx = Ndx + 1
> Set Rng = Rng(2, 1)
> Loop
> End Sub
>
> --
>
>
> Gary
>
>
> "Peter T" <peter_t@discussions> wrote in message
> news:exCGEF7%(E-Mail Removed)...
>> Search "compile" and/or "conditional compilation" in VBA help
>>
>> Regards,
>> Peter T
>>
>>
>> "NateBuckley" <(E-Mail Removed)> wrote in message
>> news:FDC8036E-475F-4A83-BF84-(E-Mail Removed)...
>>> Thank you very much, just what I wanted.
>>>
>>> Your a star.
>>>
>>> If you have the time may I ask what # means? I shall go and attempt to
>>> find
>>> out what they mean from google.
>>>
>>> Thanks again
>>>
>>> "Peter T" wrote:
>>>
>>>> #If Mac Then
>>>> ' it's a Mac
>>>> #Else
>>>> ' it's not a Mac
>>>> #End If
>>>>
>>>> Regards,
>>>> Peter T
>>>>
>>>> "NateBuckley" <(E-Mail Removed)> wrote in message
>>>> news:1506E2B1-FBC0-44F5-8E8B-(E-Mail Removed)...
>>>> > Hello I've been using WinAPI calls to do some swanky stuff, but
>>>> > although
>>>> > no
>>>> > one uses Macs where I work, I'd like (if possible) to aquire the
>>>> > operating
>>>> > system information so IF Mac then don't do WinAPI calls etc. Not
>>>> > really an
>>>> > issue at the moment but always good to know just in case.
>>>> >
>>>> > Is this possible with VBA?
>>>> >
>>>> > Cheers!
>>>>
>>>>
>>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
canstop system asking which operating system =?Utf-8?B?Z3JlbQ==?= Windows XP Help 2 13th Oct 2006 10:45 PM
Properly operating check boxes =?Utf-8?B?R2FiZQ==?= Microsoft Access 1 24th Jun 2005 10:14 AM
System Shutdown;Operating System Not Found Keith Windows XP Help 0 28th Oct 2003 07:06 PM
How can IConvert macintosh operating system 10 files To Windows operating system James Martocci Microsoft Windows 2000 Applications 0 24th Oct 2003 11:32 PM
Replace operating system on a dual boot system? David Rose Windows XP Customization 1 12th Sep 2003 02:58 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:39 AM.