Add Printer Script gives errors
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- oneorangetree
- Posts: 5
- Last visit: Wed Feb 29, 2012 9:01 am
Add Printer Script gives errors
Script: PathToScriptFile.vbsLine: 2Error: The environment is incorrectCode: 8007000ASource: (null)
- oneorangetree
- Posts: 5
- Last visit: Wed Feb 29, 2012 9:01 am
Add Printer Script gives errors
It can't be a driver issue because I copied a few lines of code from a Larger script so I can understand it better and the larger script works. The printer drivers are on the server and the larger script works fine on my PC. My code doesn't work for some odd reason Here is the Larger Script below Err.ClearPrinterNumber
- oneorangetree
- Posts: 5
- Last visit: Wed Feb 29, 2012 9:01 am
Add Printer Script gives errors
I am trying with WScript. The printer names are exact but the error says Line 2 Which is objNetwork.AddWindowsPrinterConnection
Add Printer Script gives errors
Does your script work on any other computer?
Are there any other printers mapped on this computer?
Do you have any other connections or drive mappings to the print server on this computer?
What OS are you running?
You say that if you run the larger script and pick the SAME printer it works? If so there is something in your smaller script we are missing. Have you posted the entire short version you are running?
Are there any other printers mapped on this computer?
Do you have any other connections or drive mappings to the print server on this computer?
What OS are you running?
You say that if you run the larger script and pick the SAME printer it works? If so there is something in your smaller script we are missing. Have you posted the entire short version you are running?
Add Printer Script gives errors
I'm still not getting a clear picture. First, is what you posted originally the *complete* short script?
If the larger script works, then there is something else in your short version. Are you executing the large script also with WScript? There's some piece of information we aren't seeing, either related to credentials, UAC or something else.
If the larger script works, then there is something else in your short version. Are you executing the large script also with WScript? There's some piece of information we aren't seeing, either related to credentials, UAC or something else.
Add Printer Script gives errors
Do not run it as a logon script - not startup script. They asre not the same.
YOu really need to use CSCRIPT.
Be sure the file encoding is ANSI and not Unicode. Open it in notepad and select save as an look at the encoding of the file in the box labeled 'Encoding'
Be sure you do not have garbage characters in the file which can happen if you have copied it from a web site.
YOu really need to use CSCRIPT.
Be sure the file encoding is ANSI and not Unicode. Open it in notepad and select save as an look at the encoding of the file in the box labeled 'Encoding'
Be sure you do not have garbage characters in the file which can happen if you have copied it from a web site.
Add Printer Script gives errors
I think he wrote the script but it could still have been saved as unicode. I think there is something specific about the script he is running. I forgot about checking encoding.
- oneorangetree
- Posts: 5
- Last visit: Wed Feb 29, 2012 9:01 am
Add Printer Script gives errors
The small script is being generated by an application that I wrote. Its being saved as Windows ANSI
Does that matter?
Does that matter?