+ Post New Thread
Results 1 to 6 of 6
Scripts Thread, Bat calling VBS problem in Coding and Web Development; OK I have our batch files for logon, doing all the usual stuff. Since installing SMART notebook and Office we ...
  1. #1

    MK-2's Avatar
    Join Date
    Oct 2006
    Location
    Nottingham
    Posts
    3,237
    Thank Post
    149
    Thanked 581 Times in 307 Posts
    Blog Entries
    8
    Rep Power
    199

    Bat calling VBS problem

    OK I have our batch files for logon, doing all the usual stuff.
    Since installing SMART notebook and Office we have the usual local printers like Smart notebook capture and the XPS office document printer.

    I've got a vbs script that will delete them, and if I run the script alone it works. I tried adding the vbs to the batch file using:
    wscript /B \\server\netlogon\remprint.vbs

    again for me it runs, but when you run it as a student or staff member it brings up a dialog box (not sure since I added the /B part, but just want to make sure) and stops the rest of the batch file running until you OK it.

    Is there an easier way of running a vbs file to remove certain printers on logon or should the /B switch do as it says (batch mode, hide all dialogs)?

    Cheers

  2. #2

    RabbieBurns's Avatar
    Join Date
    Apr 2008
    Location
    Sydney
    Posts
    5,512
    Thank Post
    1,320
    Thanked 469 Times in 306 Posts
    Blog Entries
    6
    Rep Power
    199
    I use cscript

  3. #3

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,154
    Thank Post
    114
    Thanked 527 Times in 450 Posts
    Blog Entries
    2
    Rep Power
    123
    Not sure if it's just a typing error in your post but that needs to be double slash B (ie wscript //b remprint.vbs)

    Have you got any wscript.echo or msgbox in the code? If so, remove them and then there's nothing to pop up.

    What does the message say?

    Can you post the code?

  4. #4

    MK-2's Avatar
    Join Date
    Oct 2006
    Location
    Nottingham
    Posts
    3,237
    Thank Post
    149
    Thanked 581 Times in 307 Posts
    Blog Entries
    8
    Rep Power
    199
    i cant remember exactly what the message was. the code doesn't have any echo or msgbox no, its just a script to search installed printers for a device id and then remove said printers (i dont want to remove all local printers)

    maybe i typed in only one backslash in the actual script, maybe that was causing it to play up. i'll have a check

    thanks

  5. #5
    Jobos's Avatar
    Join Date
    Apr 2007
    Posts
    1,132
    Thank Post
    177
    Thanked 49 Times in 42 Posts
    Rep Power
    24
    We call our vbs scripts directly from the login bat without using wscript.

  6. #6
    Jay
    Jay is offline

    Join Date
    Mar 2008
    Location
    Autocratic theocracy of Norfolk
    Posts
    71
    Thank Post
    3
    Thanked 4 Times in 4 Posts
    Rep Power
    13
    Quote Originally Posted by RabbieBurns View Post
    I use cscript
    Console script (DOS'ish) vs Windows Script (Interactive)

    What he said basically.

SHARE:
+ Post New Thread

Similar Threads

  1. Covert CMD/BAT files to vbs help
    By tosca925 in forum Scripts
    Replies: 12
    Last Post: 8th November 2007, 02:58 PM
  2. .vbs .bat error in sysvol
    By alonebfg in forum Windows
    Replies: 7
    Last Post: 16th July 2007, 07:57 PM
  3. bat versus vbs
    By Uraken in forum Scripts
    Replies: 8
    Last Post: 30th January 2007, 10:41 PM
  4. Detect Ctitrix session from within bat/vbs?
    By Geoff in forum Thin Client and Virtual Machines
    Replies: 9
    Last Post: 19th July 2006, 11:24 AM
  5. Replies: 4
    Last Post: 7th December 2005, 08:09 PM

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
  •