+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 27 of 27
Scripts Thread, New to scripting in Coding and Web Development; Thanks allot you lot it has work wooo hooo! I’m going to scarp the printer one. Not going to do ...
  1. #16

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,216
    Thank Post
    893
    Thanked 1,773 Times in 1,529 Posts
    Blog Entries
    12
    Rep Power
    461

    Re: New to scripting

    Thanks allot you lot it has work wooo hooo! I’m going to scarp the printer one. Not going to do it now put is there a script that will automatically fill in details for exchange accounts?

    Thanks Again

    Zak

  2. #17

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,216
    Thank Post
    893
    Thanked 1,773 Times in 1,529 Posts
    Blog Entries
    12
    Rep Power
    461

    Re: New to scripting

    One quick question (again) net use w: /d will delete network drive W if it already exists is there a command that will get rid off al existing drives?

    Thanks.

  3. #18

    Join Date
    Mar 2007
    Posts
    1,833
    Thank Post
    89
    Thanked 312 Times in 239 Posts
    Rep Power
    89

    Re: New to scripting

    you'll find the printer one nice and easy now tbh .

    i think the computer deletes the shares when you log off.

    pass on outlook!.

  4. #19
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,993
    Thank Post
    120
    Thanked 286 Times in 263 Posts
    Rep Power
    107

    Re: New to scripting

    Try

    Code:
    net use * /d
    I dont think that will work but try it.

  5. #20

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,216
    Thank Post
    893
    Thanked 1,773 Times in 1,529 Posts
    Blog Entries
    12
    Rep Power
    461

    Re: New to scripting

    @ChrisH nope didn't work, anyone else got any ideas?

    Thanks

  6. #21
    ChrisC's Avatar
    Join Date
    Mar 2006
    Location
    Dorset
    Posts
    767
    Thank Post
    2
    Thanked 1 Time in 1 Post
    Rep Power
    19

    Re: New to scripting

    as chris says

    i think in terms of ease, it's best to just have a list of

    net use [drive:] [path] /delete /yes
    net use [drive:] [path] /delete /yes
    net use [drive:] [path] /delete /yes
    net use [drive:] [path] /delete /yes

    Chris

  7. #22
    User3204's Avatar
    Join Date
    Aug 2006
    Location
    Wirral
    Posts
    769
    Thank Post
    55
    Thanked 66 Times in 62 Posts
    Rep Power
    34

    Re: New to scripting

    If you do:

    net use * /d

    this should drop all network shares, assuming you don't have any files open from the shares, I run this at logon (and logoff.... actually), to make sure that I can map correctly.

    actually, if you want to check the switches on net use, you can run a command prompt and type:

    net use /?

    The problem I always come across in BAT files is that it uses the "command.com" NOT the "cmd.com" to run stuff, which is very inconvenient sometimes.


    I am switching over a lot of my existing logon scripts from BAT files to have fewer VBS files.

    And I don't use outlook or exchange at school.

  8. #23

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,216
    Thank Post
    893
    Thanked 1,773 Times in 1,529 Posts
    Blog Entries
    12
    Rep Power
    461

    Re: New to scripting

    ok i will have a look at that tomorrow, thanks

  9. #24

    Join Date
    Jan 2007
    Location
    Enfield, London
    Posts
    159
    Thank Post
    7
    Thanked 3 Times in 3 Posts
    Rep Power
    17

    Re: New to scripting

    Quote Originally Posted by User3204
    If you do:

    net use * /d

    this should drop all network shares, assuming you don't have any files open from the shares, I run this at logon (and logoff.... actually), to make sure that I can map correctly.
    Don't forget to add the /y switch or the script will hang, waiting for you to press yes or no.

    The problem I always come across in BAT files is that it uses the "command.com" NOT the "cmd.com" to run stuff, which is very inconvenient sometimes.
    Why don't you just use the .cmd file extension. This will enable the enhanced features of the cmd.exe command processor

  10. #25

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,216
    Thank Post
    893
    Thanked 1,773 Times in 1,529 Posts
    Blog Entries
    12
    Rep Power
    461

    Re: New to scripting

    i have just tested the "net use * /d" its not working

  11. #26

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,157
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    124

    Re: New to scripting

    Quote Originally Posted by User3204

    The problem I always come across in BAT files is that it uses the "command.com" NOT the "cmd.com" to run stuff, which is very inconvenient sometimes.
    Unless you've done something very strange, then .BAT will run in cmd.exe (try it - put the word pause in test.bat and run it - you'll see cmd.exe appear in taskmgr but no command.com)

    if you want to have a slightly shorted command to unmap all drives then:

    Code:
    for %i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do net use %i: /d
    should work - you can test that at a command prompt.

    In a batch file you need to double up the % signs:

    Code:
    for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do net use %%i: /d

  12. #27
    mark's Avatar
    Join Date
    Jun 2005
    Posts
    3,983
    Thank Post
    268
    Thanked 52 Times in 46 Posts
    Blog Entries
    2
    Rep Power
    47

    Re: New to scripting

    I tag on /persistent:no to the end of a mapping so that the drive isn't mapped permanently.

    net use p: \\servername\public /persistent:no

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Scripting Resources
    By ChrisH in forum Scripts
    Replies: 20
    Last Post: 27th March 2012, 11:39 AM
  2. Delete a folder using scripting
    By FN-GM in forum Scripts
    Replies: 15
    Last Post: 22nd December 2007, 04:44 PM
  3. using the 'auto configuration Scripting' in IE
    By Liam in forum How do you do....it?
    Replies: 9
    Last Post: 25th October 2007, 01:34 PM
  4. ADMT and or Scripting ACL changes.
    By pete in forum Windows
    Replies: 4
    Last Post: 25th October 2006, 08:38 PM
  5. Scripting IP configuration.
    By Dos_Box in forum Scripts
    Replies: 3
    Last Post: 2nd September 2005, 09:07 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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