Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default windoes system directoty?

Dear all,

I thought there was an easy way to get the windows system
directory but I can't find it.

Anybody an idea?

Thanks,

JOhn
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default windoes system directoty?

%windir%

You can put that directly into a path.


--

Regards,


Bill Lunney
www.billlunney.com

"John" wrote in message
...
Dear all,

I thought there was an easy way to get the windows system
directory but I can't find it.

Anybody an idea?

Thanks,

JOhn



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default windoes system directoty?

Thanks Bill for your quick reply,really appreciated.
However... I am not sure how to use and can't find help on
it.

I am trying to replace the "c:\winnt\" in the following
code so help will always be found no matter where my xla
is called from:

Sub ShwHelp()
Application.Help "C:\WINNT\TPBQ.CHM"
'%windir%
End Sub

Any idea?

Thanks for your help.

John



-----Original Message-----
%windir%

You can put that directly into a path.


--

Regards,


Bill Lunney
www.billlunney.com

"John" wrote in message
...
Dear all,

I thought there was an easy way to get the windows

system
directory but I can't find it.

Anybody an idea?

Thanks,

JOhn



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default windoes system directoty?

In Excel XP, I can do the following....

Sub Demo()
Dim s
s = Application.OperatingSystem ' If you want to test
s = CreateObject("Scripting.FileSystemObject").GetSpec ialFolder(0)
Debug.Print s
End Sub

Returns...
C:\WINDOWS

--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"John" wrote in message
...
Thanks Bill for your quick reply,really appreciated.
However... I am not sure how to use and can't find help on
it.

I am trying to replace the "c:\winnt\" in the following
code so help will always be found no matter where my xla
is called from:

Sub ShwHelp()
Application.Help "C:\WINNT\TPBQ.CHM"
'%windir%
End Sub

Any idea?

Thanks for your help.

John



-----Original Message-----
%windir%

You can put that directly into a path.


--

Regards,


Bill Lunney
www.billlunney.com

"John" wrote in message
...
Dear all,

I thought there was an easy way to get the windows

system
directory but I can't find it.

Anybody an idea?

Thanks,

JOhn



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default windoes system directoty?

In a command window you can do

Echo %windir%
and it returns
C:\Winnt
on my system. Not sure how you would use it in VBA

You can check the comspec environment variable

? environ("comspec")
C:\WINNT\system32\cmd.exe

or
? environ("windir")
C:\WINNT

I am on Win 2K and I can't guarantee that these environ variables will be
defined on every OS version.

Other methods:

http://support.microsoft.com/default...b;en-us;170728
OFF97: Macro to Get Windows and Windows System Directories

http://support.microsoft.com/default...b;en-us;213496
XL2000: Macros to Return Windows and System Directory Paths

http://support.microsoft.com/default...b;en-us;108278
XL: Macros to Return Windows and System Directory Paths

--
Regards,
Tom Ogilvy




"John" wrote in message
...
Thanks Bill for your quick reply,really appreciated.
However... I am not sure how to use and can't find help on
it.

I am trying to replace the "c:\winnt\" in the following
code so help will always be found no matter where my xla
is called from:

Sub ShwHelp()
Application.Help "C:\WINNT\TPBQ.CHM"
'%windir%
End Sub

Any idea?

Thanks for your help.

John



-----Original Message-----
%windir%

You can put that directly into a path.


--

Regards,


Bill Lunney
www.billlunney.com

"John" wrote in message
...
Dear all,

I thought there was an easy way to get the windows

system
directory but I can't find it.

Anybody an idea?

Thanks,

JOhn



.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default windoes system directoty?

Xp is just NT5 odd and they should be quite similar. The big difference when it comes to
Environ is NT/9x, they vary far too much in general. I suggest using API functions
http://www.mvps.org/vbnet/code/system/windirs.htm
for those things.

--
HTH. Best wishes Harald
Excel MVP

Followup to newsgroup only please.

"Bob Phillips" wrote in message
...
Both work equally well on my XP system. Will try NT4 tomorrow.

--

HTH

Bob Phillips

"Tom Ogilvy" wrote in message
...
In a command window you can do

Echo %windir%
and it returns
C:\Winnt
on my system. Not sure how you would use it in VBA

You can check the comspec environment variable

? environ("comspec")
C:\WINNT\system32\cmd.exe

or
? environ("windir")
C:\WINNT

I am on Win 2K and I can't guarantee that these environ variables will be
defined on every OS version.

Other methods:

http://support.microsoft.com/default...b;en-us;170728
OFF97: Macro to Get Windows and Windows System Directories

http://support.microsoft.com/default...b;en-us;213496
XL2000: Macros to Return Windows and System Directory Paths

http://support.microsoft.com/default...b;en-us;108278
XL: Macros to Return Windows and System Directory Paths

--
Regards,
Tom Ogilvy




"John" wrote in message
...
Thanks Bill for your quick reply,really appreciated.
However... I am not sure how to use and can't find help on
it.

I am trying to replace the "c:\winnt\" in the following
code so help will always be found no matter where my xla
is called from:

Sub ShwHelp()
Application.Help "C:\WINNT\TPBQ.CHM"
'%windir%
End Sub

Any idea?

Thanks for your help.

John



-----Original Message-----
%windir%

You can put that directly into a path.


--

Regards,


Bill Lunney
www.billlunney.com

"John" wrote in message
...
Dear all,

I thought there was an easy way to get the windows
system
directory but I can't find it.

Anybody an idea?

Thanks,

JOhn


.







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default windoes system directoty?

Harald,

Just continuing the line Tom started really, but personally I would use the
method that Dana proposed. I don't have a 9x system to hand to test it, but
I would be surprised if that failed to work on them.

Regards

Bob

"Harald Staff" wrote in message
...
Xp is just NT5 odd and they should be quite similar. The big difference

when it comes to
Environ is NT/9x, they vary far too much in general. I suggest using API

functions
http://www.mvps.org/vbnet/code/system/windirs.htm
for those things.

--
HTH. Best wishes Harald
Excel MVP

Followup to newsgroup only please.

"Bob Phillips" wrote in message
...
Both work equally well on my XP system. Will try NT4 tomorrow.

--

HTH

Bob Phillips

"Tom Ogilvy" wrote in message
...
In a command window you can do

Echo %windir%
and it returns
C:\Winnt
on my system. Not sure how you would use it in VBA

You can check the comspec environment variable

? environ("comspec")
C:\WINNT\system32\cmd.exe

or
? environ("windir")
C:\WINNT

I am on Win 2K and I can't guarantee that these environ variables will

be
defined on every OS version.

Other methods:

http://support.microsoft.com/default...b;en-us;170728
OFF97: Macro to Get Windows and Windows System Directories

http://support.microsoft.com/default...b;en-us;213496
XL2000: Macros to Return Windows and System Directory Paths

http://support.microsoft.com/default...b;en-us;108278
XL: Macros to Return Windows and System Directory Paths

--
Regards,
Tom Ogilvy




"John" wrote in message
...
Thanks Bill for your quick reply,really appreciated.
However... I am not sure how to use and can't find help on
it.

I am trying to replace the "c:\winnt\" in the following
code so help will always be found no matter where my xla
is called from:

Sub ShwHelp()
Application.Help "C:\WINNT\TPBQ.CHM"
'%windir%
End Sub

Any idea?

Thanks for your help.

John



-----Original Message-----
%windir%

You can put that directly into a path.


--

Regards,


Bill Lunney
www.billlunney.com

"John" wrote in message
...
Dear all,

I thought there was an easy way to get the windows
system
directory but I can't find it.

Anybody an idea?

Thanks,

JOhn


.









  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default windoes system directoty?

Just another test:
Windows 98 SE

? environ("comspec")
C:\WINDOWS\COMMAND.COM
? environ("windir")
C:\WINDOWS


Comspec has been valid since DOS 1.x or there about. I don't know about
windir

As to Dana's suggestion, no guarantee that the scripting runtime is present
although I expect it would be in most cases.
It worked in Windows 98 SE. The API would work in all 32 bit versions I
would think.


Regards,
Tom Ogilvy




Harald Staff wrote in message
...
Xp is just NT5 odd and they should be quite similar. The big difference

when it comes to
Environ is NT/9x, they vary far too much in general. I suggest using API

functions
http://www.mvps.org/vbnet/code/system/windirs.htm
for those things.

--
HTH. Best wishes Harald
Excel MVP

Followup to newsgroup only please.

"Bob Phillips" wrote in message
...
Both work equally well on my XP system. Will try NT4 tomorrow.

--

HTH

Bob Phillips

"Tom Ogilvy" wrote in message
...
In a command window you can do

Echo %windir%
and it returns
C:\Winnt
on my system. Not sure how you would use it in VBA

You can check the comspec environment variable

? environ("comspec")
C:\WINNT\system32\cmd.exe

or
? environ("windir")
C:\WINNT

I am on Win 2K and I can't guarantee that these environ variables will

be
defined on every OS version.

Other methods:

http://support.microsoft.com/default...b;en-us;170728
OFF97: Macro to Get Windows and Windows System Directories

http://support.microsoft.com/default...b;en-us;213496
XL2000: Macros to Return Windows and System Directory Paths

http://support.microsoft.com/default...b;en-us;108278
XL: Macros to Return Windows and System Directory Paths

--
Regards,
Tom Ogilvy




"John" wrote in message
...
Thanks Bill for your quick reply,really appreciated.
However... I am not sure how to use and can't find help on
it.

I am trying to replace the "c:\winnt\" in the following
code so help will always be found no matter where my xla
is called from:

Sub ShwHelp()
Application.Help "C:\WINNT\TPBQ.CHM"
'%windir%
End Sub

Any idea?

Thanks for your help.

John



-----Original Message-----
%windir%

You can put that directly into a path.


--

Regards,


Bill Lunney
www.billlunney.com

"John" wrote in message
...
Dear all,

I thought there was an easy way to get the windows
system
directory but I can't find it.

Anybody an idea?

Thanks,

JOhn


.









  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default windoes system directoty?

But I'd think that
either C:\WINDOWS\SYSTEM or C:\WINDOWS\SYSTEM32 would be my "windows

system directoty" :-)

True, but it should only be one step down.

I would go with the API which I provided links to KB articles showing how
in my original post.

Regards,
Tom Ogilvy

"Harald Staff" wrote in message
...
Windows 98 SE

? environ("comspec")
C:\WINDOWS\COMMAND.COM
? environ("windir")
C:\WINDOWS


Yes, those work here too. Other Environ's, like "User" doesn't on 9x. But

I'd think that
either C:\WINDOWS\SYSTEM or C:\WINDOWS\SYSTEM32 would be my "windoes

system directoty" :-)

Best wishes Harald
Excel MVP

Followup to newsgroup only please.





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert military date system to standard date system John Weaver Excel Discussion (Misc queries) 8 September 17th 09 06:12 PM
How do I open an Excel file on XP system, saved on a Vista system JLS7 Excel Discussion (Misc queries) 3 December 2nd 08 04:21 AM
not enough system resources Jennifer Excel Discussion (Misc queries) 0 December 10th 07 04:06 PM
system clipboard Jim B Excel Discussion (Misc queries) 1 December 4th 05 10:00 PM
excel causing system to be in low system resource inenewbl Excel Discussion (Misc queries) 0 April 5th 05 04:11 PM


All times are GMT +1. The time now is 03:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"