Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




How Do I Find Windows System Directory?


Does anyone know how to find out what the windows system directory is without make a sub to check if the directory exists?

thanks




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Windows And System Directory
Hi, I have a question. Is there a way to know which is the "windows directory" and the "windowssystem directory?"

In XP, is WindowsSystem32
In Windows 98 is WindowsSystem
In Nt is WinNT ...

and I have to make reference to a dll to registrate it at running time ...

Ok, thanks a lot.

How Do I Get Windows System Directory?
How do I get the complete system directory path on all windows platforms?
I mean:
c:windowssystem
d:winntsystem32
etc.

Thanx
Manish

Can I Always Write To The Windows System Directory ?
My application uses a number of DLLs that I have packaged with it.
But for ease of deployment I have included the .dlls into the .exe, and at runtime if the system doesn't have the .dlls it extracts them to the windows system directory.

But is there any situation in which I would not be able to write to the system directory ?
I personally can't think of one, but I thought I'd ask just in case...

How: Find The Windows Directory
is there a command or variable that will get me the equivalent of the dos variable %systemroot% or %windir%.

In other words I want to know where the os is installed, whether c:windows or c:winnt. as I need to use that path in the statement I am writing.

Find Windows Directory (found Example)
How would I find out what the windows system directory is.

like c:Windows or c:WINNT

Thank you for your help

Jason

How Do I Find The 'Media' Directory In Windows
Is there an API that can be called to find the 'media' directory in windows.

Can VBScript Find Windows Directory Path?
Hello!
how to find out through VBS the path to the %windir% on current pc?

sanx!

How To Find Windows Default Temp Directory Location
Hi,

With VB code. How do I find the default windows temp directory.

I guess there is an API to get this information.

Some of my machine have WinXP or Win2K or else, so windows directory is either WinNT or WinDows ... so I need to need to get that folder automatically with the Temp folder.



Edited by - ndbu on 9/16/2005 7:41:09 AM

How To Find Windows Which R Minimized To The System Tray (FindWindow)?
Greetings every1,
I can find windows with the FindWindow API. So far so good. But it finds only windows that r present on the taskbar. Windows which have been minimized to the system tray like Yahoo messenger cannot b found. How to find these windows which r minimized to the system tray. Plz help...

How To Add Things To System.ini Or System.dat So Program Runs When Windows Start ?
Hi,

Pls tell me how and what to add things to system.ini or system.dat so program runs when windows start ?

note: i am workin on a pc locking program.

thnx in advance

How To Find The Remote System Name Using That System Ip Address
Hi


How to find the remote system name using that system ip address?

U.Srikanth

Winsock And Directory List Box To Get Directory List Of A Remote System
hi,
I am using winsock control to transfer the items listed in a directory listbox, to display the list of folder names.The problem is if we move to c:dir1dir2dir3 then again come to c: i am still getting the directory list of c:dir1dir2dir3 .All the changes are done in the directory list box by coding.

Custom Database Viewer Will Open In Windows XP But Not Windows 2000 Operating System
Hello,

I have a VB 6.0 program that was created in Windows XP that allows people to view microsoft access data in a custom form using ADO technology. In order for this to work I have code that will check the users system folder to see if MSBIND.dll is in there. IF it isn't then it will install it as it is needed to view the data. The program works fine in Windows XP but now I have tested it out in Windows 200 and I get databinding errors.

I use the system function "GetWindowsDirectory" and when I check to see where msbind.dll is being stored it says C:WINNTSystem32MSBind.dll

I guess my question is, is this where I should be putting my msbind.dll? If so and the dll is not my problem, does anyone know of any problems that could be encountered by a Windows 2000 machine but not a Windows XP machine?

Thank you

Using A Program To Find Files. Without Using Apis To Call Up Windows Find
i would like to locate a file using straite code in viaula basic

can you help me out??

thanks

I Don't Want My Dll In The System Directory
I am writing a program that uses functions a dll. How can I place the dll file in the same directory and have access to it?

private Declare Function PrintInvoice lib "proutines.dll" (Byval lInvoiceNo As Long) As Long

This declare causes vb to look in the system directory for the dll. If I include the directory name, it doesn't work either

private Declare Function PrintInvoice lib "C:My Documentsproutines.dll" (Byval lInvoiceNo As Long) As Long

any suggestions?

System Directory
Hi Expert, ihave a
1- 2 command buttons
2-i want when i click on it send my file (logo.dll) to file system (system32)
3-and reverse action when i click in second button open it please help me guy's

System Directory
Does anyone know how to get the system directory
f.e. "C:WindowsSystem", or "C:WINNTSystem32"?

I know how to get the temp directory:


Code:
Declare Function GetTempPath Lib "kernel32" Alias _
"GetTempPathA" (ByVal nBufferLength As Long, ByVal _
lpBuffer As String) As Long

Public Const MAX_PATH = 260

Function GetTempDir()
On Error Resume Next
Dim TempDir As String
TempDir = String(MAX_PATH, 0)
If GetTempPath(MAX_PATH, TempDir) <> 0 Then
GetTempDir = Left(TempDir, InStr(TempDir, _
Chr(0)) - 1)
Else
GetTempDir = ""
End If
End Function


Any suggestions?

thx, vbzero

Finding The System Directory
Is there any way to get the system directory from any computer? I know there's the Environ thing, but that only works on 2k/xp computers, and it's apparently not standard. this:

Code:
Mid(Environ(16), InStr(1, Environ(16), "=") + 1, InStr(1, Environ(16), ";") - InStr(1, Environ(16), "=") - 1)
showed the system directory on my comp (win2k), but on an XP comp, it got an error because it returned "processor_level=6", instead of a list of directories.
I need a way of getting the system directory on Windows 98 (and SE), 2000, and XP.

System Directory Paths????
How do I get the "System Root", "App Path", "Home Dir", etc directories?

Find Directory
Quick one here,

I want to be able to select a button and then provide a box similar to the common dialog box where instead of finding a filename the user can select a directory and then return that location. Any ideas. I've done it before but can't remember how!

Find A Directory
A module in my program contains the following information.


Code:
Declare Function TV_SetNumber Lib "C:Program FilesProgram X.x (Version yyyy)
(Byval input1 as long, byval input2 as double) as long

Declare Function TV_GetNumber Lib "C:Program FilesProgram X.x (Version yyyy)
(byval input1 as long) as double
The problem is when two computers have a different version of Program X.x, the directory is different. How can I detect the path on each computer?

How To Find The Directory
Hello,

I have to read a file and it is in c:windows in my PC. I have windows 95 installed in my machine.


But in the user's machine windows 2000 is installed and the
file is in c:winnt


how can I in my program, find out whether the file is in
c:windows or c:winnt


I would highly appreciate, if someone can help me soon.


Thanks

Find A Name Using A Directory
i want to find a name in a folder using DIR AND show in
the sreen.



Thanks

How To Find A Directory Name (still)
for example
i want to check a name of directory , Was there is
if no, i need to create the name of that directory

and

how to make the function like "dir" on DOS

thanks for your help...

How Can I Find A Directory...
How can I find if a directory is exist in my computer
and how can i find the path to it.

Find A Directory
In my code I need to be able to search for a directory to find out if it is created or not and if not then I need to create it. The create part is not a problem. I have been fighting with this for a couple of days now and I'm getting nowhere. Thanks for the help.

Find A Directory ..please Help Me
Using the FileSystemObject within a wmi .vbs script, I need someone to help me find a way to:

Search for a folder within a given path and search it with a variable name, (the folder name is unknown). I'm trying to find a folder named *.slt This file is a netscape profile folder, which is randomly generated for each profile for each user on the network.

once the folder is found on either NT (%windir%profilesusernameapplication datamozillaprofiles*.slt) or XP/2k (%homedrive%documents and settingsusernameapplication datamozillaProfiles*.slt)

it will copy a file to that directory.

If someone has a command line script (.cmd or .bat) with finding if a folder exists that will be better than a vbs file. I have found many vbs scripts that find a folder by date or a specific name but none that do what I want.

Thank you in advance!!!!,

P.S. I dont know how to write vb at all, newbie

Find A Directory ..please Help Me
Using the FileSystemObject within a wmi .vbs script, I need someone to help me find a way to:

Search for a folder within a given path and search it with a variable name, (the folder name is unknown). I'm trying to find a folder named *.slt This file is a netscape profile folder, which is randomly generated for each profile for each user on the network.

once the folder is found on either NT (%windir%profilesusernameapplication datamozillaprofiles*.slt) or XP/2k (%homedrive%documents and settingsusernameapplication datamozillaProfiles*.slt)

it will copy a file to that directory.

If someone has a command line script (.cmd or .bat) with finding if a folder exists that will be better than a vbs file. I have found many vbs scripts that find a folder by date or a specific name but none that do what I want.

Thank you in advance!!!!,

P.S. I dont know how to write vb at all, newbie

Using Dlls That Are Not Located In System Directory
Hi
I've seen how api's get declared and a comon thing I think is all those dlls are located in the system directory.
But what if I need to use a normal dll, that's not really part of api, just a dll written in VC let's say?
How would I inlcude the path(I could just copy it in the same dir, will that work?)?
Thanks!

How To Copy A File To System Directory
how to copy a file to system directory(such as windows, program files, windows/system32) in winXP. If I do so using FSO it prompts an error message "You dont have previlage to do so" even if I run the program in administrator login.

Find A File In Directory
I want to find if a particular file exists in a folder. I know the file name & folder name. I am using file system object to do this. I would like to know if it is possible to do this using simple ways like using dir object or anything else.

ChDir Can't Find Directory
V$ = "D:CHEXMODULE1.BAS"
ChDir V$
I wrote the above code to find a certain file. The file Module1.bas is in the Directory "CHEX". I know because I've triple checked it, yet the stupid thing comes up with a err number 76, WHY? Some of these file commands in VB do not seem to work the same way or are as reliable
as the same commands in Basic 7.11! Dir command seems to be a big hassle to use.

Find My Documents Directory From Vb
is there a variable or function to get the directory of the "My Documents" dir of the current user?

Find Root Directory
Can someone advise me on the code to display the users Windows root directory(e.g. /windows/system32)? Thanks.

-christoph

Where To Find The Emails Directory??
Hello guys..

I was trying to play with emails that arrive my PC..

What is the folder for all emails that comes from SMTP??

I mean how to capture them??

Or how to capture emails that I'm sending.. or before sending them.. (Like Anti-Virus programs do )

Any help is greatly appreciated..

thanks!

Is There A Better Way To Find The Directory Structure?
Hi All,

I need to find the directory structure for a file and then store this in a vairable.

E.G.


VB Code:
dim Source as Stringdim Path as String Source="c: empanotherdirmyfile.txt"Path= ' ????????? needs to be c: empanotherdir  


The only way I can think of doing this is to have a loop which looks for the last "" then stores the infromation previous to this.

Im pretty sure that this will work fine, but I was wondering if anyone could think of a more effiecient way of doing it?

Thanks!

Paul.

Find Out If Directory Exist
How do I find out if a directory exist without using filesystemobject. The directory might be empty so I cant make a wildcard search in it for files.

GunYan

How Can I Find Out If There Is A Directory In A Path?
hi guys, I wonder if there is a way OR an API function that will tell me whether there are any directories in a given path or not. For example I want to check to see if any directory exists in "c:windows" or not. I have written this function and I'm not sure if it always works correct. The problem is that I have to use this in a forloop and it is extreemly slow. So I need a better way of doing it

VB Code:
Private Function DoesPathContainDir(ByVal strPath As String) As Boolean    Dim mEntry As String        ' Ensure that the path ends with the '' character    If Right(strPath, 1) <> "" Then        strPath = strPath & ""    End If        mEntry = Dir(strPath, vbDirectory)    Do While mEntry <> ""        If mEntry <> "." And mEntry <> ".." Then            If (GetAttr(strPath & mEntry) And vbDirectory) = vbDirectory Then                DoesPathContainDir = True                Exit Function            End If        End If        mEntry = Dir()    Loop        DoesPathContainDir = FalseEnd Function


there MIGHT be a problem with my function too, but it works fine when I test it in the immidiate window

thanks for the help!

also! does this sound right in the code?: Do While mEntry <> ""

How To Find Out How Many Folders In A Particular Directory? Am I Doing This Right?
Hi there got another bug on my ming. Been searching the forum for a quick way to get the number of folders and sub folders (all existing folders) in a particular directory but could not find anything usable. So... I tried to come up with a way using a double loop to do it but I am missing something in my code I'm sure because it wont return all of the folders in the directory queried, just part of them.
Anybody know how I can make this work or if there's an easier way to do this?. BTW this works fairly fast and it is defenatly better then calling a routine to expand my treeview and do a nodes count (which I was using before)
Needless to say Iam not quite there yet with VB Oh wel...
Thanks in advance

VB Code:
Private Sub Command1_Click() Call NumOfFoldrsEnd Sub Sub NumOfFoldrs() Dim fso As New FileSystemObject Dim NumFold As Long Dim fld As Folder Dim Fold As Folder Dim x As String Dim i As String NumFold = 0 On Error Resume Next  Set fld = fso.GetFolder("c:Windows")       For Each fld In fld.SubFolders   x = fld.Path    NumFold = NumFold + 1  '<- folder count of C:Windows directory    Set Fold = fso.GetFolder(x)    For Each Fold In Fold.SubFolders    i = Fold.Name   NumFold = NumFold + 1  '<- should count all existing folders in C:Windows but does,nt. Next Next   MsgBox NumFoldEnd Sub

How To Find Out If A Sub Directory Is Empty?
I want to delete a sub directory only if it is empty. Does anyone know how I can determine this and the best way to go about deleting it?

Thanks

How Do If Find The Size Of A Directory
with "c:hi"
i want to find the amout of MB is in there.

how do i do this fast in vb.

Thanx

Find The Directory A Program Is Being Run From ??
Is this possible? Say I compile prog1.exe in c:samples, and I execute it, is there a way for the program to detect the directory it is being run from? I tried CurDir, but nah, that didn't work.

anyone???

Find The WINWORD.EXE Directory
Hello,

the information that you asked can be found on the registry and the location is:
My ComputerHKEY_LOCAL_MACHINESoftwareMicrosoftOffice8.0WordInstallRoot

well that applies to Word 97 only not others.. Word 2k uses 9.0 instad of 8.0

I guess otherwise your is to make a harddisk scanner and use it to find it...

and how to access registy, look under the Topic Areas:Registry

------------------
-Matti Kiviranta
AyS of AyS Systems
Move yourrr body
"Eiffel65 - Move your body"

Find The WINWORD.EXE Directory
Hello,

the information that you asked can be found on the registry and the location is:
My ComputerHKEY_LOCAL_MACHINESoftwareMicrosoftOffice8.0WordInstallRoot

well that applies to Word 97 only not others.. Word 2k uses 9.0 instad of 8.0

I guess otherwise your is to make a harddisk scanner and use it to find it...

and how to access registy, look under the Topic Areas:Registry

------------------
-Matti Kiviranta
AyS of AyS Systems
Move yourrr body
"Eiffel65 - Move your body"

Find A File In A Directory
I have a directory that holds about 300 files all are images except one. I need to find the filename of the only non-image file. It will always be a text file. Any suggestions?

Find Which Directory The .exe Is Running From
I know that there is a piece of code that I could use to say Code:<the directory that this .exe is running from>foldernamea file.txt but I can't find the piece of code and I don't know what to search for to find it

does anyone know what it is?

thanks



Edited by - minalth on 11/4/2004 7:21:41 AM

How Do Find Currnet Directory?
How do you find out what the current directory is for you VB app? For example, if you isntalled to given directory how do you find out what the directory is?

I tried
Results = GetModuleFileNameA(0, CurrentDirectory, 500)

But that gives me the install path of visual basic, not my application.

How Can I Find All The .exe File In A Certain Directory ?
How can I find all the .exe file in a certain directory like the "find files and folds..." in windows? Which function need I use?

Thank you!

Best Regards,

Kevin Shen

File System Object - Copy Directory?
hi all

i have been successfully using the CopyFolder method of the file system object to move folders around, however i want to create a small backup program to literally take the entire contents of one drive and move it to another drive. the CopyFolder method will not work with just a drive root ie:


Code:
FSO.CopyFolder "D:", "I:"
i cant find a list of all the file system object's methods, and couldnt find anything relating to this on the forum search...

if anyone knows how to copy all contents of a drive, your help would be appreciated

thanks

andyoftheuk

Copyright 2005-08 www.BigResource.com, All rights reserved