Results 1 to 10 of 10

Thread: %windir%

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2003
    Posts
    32

    %windir%

    What is the syntax for finding the windir, and putting it into a string and adding /system32

    I have Dim strWinDir As String
    strWinDir = %WINDIR%&"\system32"

    but it says that the first % in %WINDIR% is invalid! Please help!



    Josh
    Smartbar XP is WAY better then Dashboard. http://www.smartbarxp.com

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    this line of code gets system directory
    VB Code:
    1. Dim sysdir As String = System.Environment.SystemDirectory
    2. msgbox (sysdir)

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2003
    Posts
    32
    thanks, that fixed it. What I need to know now is, why it wont let me delete a file it created from a dll. I tried using File.Delete, and it didnt work, and Kill("") and it didnt work. I always got access denied errors. Can u help me figure out how to delete files?


    Josh
    Smartbar XP is WAY better then Dashboard. http://www.smartbarxp.com

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    are you trying to delete system dll files ??

  5. #5

    Thread Starter
    Member
    Join Date
    Jan 2003
    Posts
    32
    No, no... It is a skinning program. To change the skin, you replace a system file. I just need to delete the system file, then send the new file on over.


    Josh

    PS pirate, do u have an IM address?
    Smartbar XP is WAY better then Dashboard. http://www.smartbarxp.com

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    this delete the dir and sub-dirs and files if set to true otherwise it won't .

    VB Code:
    1. 'true means you delete all sub-dir and files
    2. IO.Directory.Delete(yourpath, True)

  7. #7

    Thread Starter
    Member
    Join Date
    Jan 2003
    Posts
    32
    ok, here is how I want it implacated:

    File.Move("C:\WINDOWS\system32\wmploc.dll", "C:\WMPT\wmploc.old")

    Instead of C:\WINDOWS, %windir%

    so, how would I do that?


    Josh
    Smartbar XP is WAY better then Dashboard. http://www.smartbarxp.com

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I tried this and worked ? Just use it like you did .any problems??
    VB Code:
    1. File.Move("c:\text.txt", "c:\aa\text.txt")

  9. #9

    Thread Starter
    Member
    Join Date
    Jan 2003
    Posts
    32
    Um, how do u open a new form? In VB 6, u just said form1.load and then form1.show or whatever, it doesnt work like that in VB.NET. Thanks for all the help.


    Josh
    Smartbar XP is WAY better then Dashboard. http://www.smartbarxp.com

  10. #10
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    VB Code:
    1. Dim frm As New Form1()    ' or another form
    2. frm.Show()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width