• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Plot file script trouble

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Ravsitar

Member
Joined
Jun 4, 2003
Location
Minnetonka, MN
I feel like I'm totaly out of my element here in the programing threads. Anyway. Here's the trouble. I have a small visual basic script that I use to send plotfiles to my printers at home. I need to use it here at work and I can't remember the exact wording. This is what I've got and it's nearly correct.

copy($file,'\\NTAUTOMP\HP4050')

Only when I use it I get an error that says:

Windos script error


line: 1
char: 6
error: syntax
code: 800a03ea
source: microsoft vbscript compiliation error


I know I can reach the printer at that local cause I can copy files to it with a command promt. And I know VB is working cause my other scripts are fine. Any ideas? Thanks.
 
I don't know Visual Basic, but in BASIC you'd have "file$" instead of "$file". I have no clue if it'll help, but I guess it's worth a shot till some VB gurus stick there head in here :)

JigPu
 
Tried it and no dice. That shifts the error to Char 10 which is where the $ went to. Thanks for the suggestio though.
 
Never mind. I just waited till I got home and looked up the old one. It's actually a .bat file not a .vbs

copy %1 \\CREFP\crprt32

In case anyone wanted to know.
 
for what it's worth, this issue was most likely the variable name since VB doesn't like the whole $variablename convention.

You would need something like
Code:
Dim myFile

myFile = "path to file" 'could be hardcoded or read from cmd line
copy(myFile,'\\NTAUTOMP\HP4050')
[code]

The batch file is probably a lot betther though since you would need to call the vbs with cscript or wscript and you would most likely just put that in a batch file to make it easier.
 
Back