Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

renaming files using VB Script

  • 05-08-2005 9:30am
    #1
    Closed Accounts Posts: 202 ✭✭


    Doesn't matter got it working

    Mod's please delete


Comments

  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    You should not delete requests like this. If you got it working it is better to leave your question and post the solution. That way anyone else at a later date can see what the issue was and fix it.

    I believe this is in the charter?


  • Closed Accounts Posts: 9,314 ✭✭✭Talliesin


    What did you get working? How did you get it working?

    I'm going to start getting irritated soon.


  • Closed Accounts Posts: 202 ✭✭eyebrows


    OK. I needed to change the name of a file using vb script. My code was


    strDir = "C:\whatever\"

    Set objScript = CreateObject("Scripting.FileSystemObject")

    Name strDir & "oldname.classit" As strDir & "newname.class"


    this worked in vb but would not work in vbs. it gave an error at the 'as' saying it should be end of statement.
    I fixed it by changing it to:


    objScript.movefile strDir & "oldname.class", strDir & "newname.class"


    so basically the 'name' function would not work in vbs but the movefile(which renames it for me) would




    sorry about that. I'll have to give the charter another read.(last time was months ago)

    Rob


Advertisement