[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 377
  • Last Modified:

vbs script error

doing a simple map for a drive thru active directory.
gives an error. screen shot included.


net use Y:  \\kisvmapp1\abra_suite
go to endy
:endy

Open in new window

0
geriatricgeek
Asked:
geriatricgeek
1 Solution
 
HubasanCommented:
I can't see any screenshots attached, but the only problem from the code I can see is you spelled GO TO as separate words, it should be GOTO.

Mapping procedure and syntax looks good, as long as user who is mapping the Y: drive as access to it.
0
 
TakedaTCommented:
Question title says vbscript while code is batch?  And Hubasan is right about the goto part also.
0
 
geriatricgeekAuthor Commented:
i don't  know why the screen shot did not upload. but the error box says:
line 1
char 9
error: expected end of statement
code: 800a0401
source: microsoft vbscript compilaiton error
 
it gave that even after making goto one word.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
HubasanCommented:
Well, the problem is that you are writing a batch script to VBS file and that just doesn't work.

What you have to do is copy the code you posted to a blank txt file and save it as "MapYDrive.bat"

and then just double-click on it and your Y: drive should be mapped.
0
 
geriatricgeekAuthor Commented:
ok. i think i'm on to something. what is the difference between batch and vbs?
0
 
jharrell2Commented:
the code you're using is batch script not vbs.  They're just different programming languages Like C# is to Visual basic.  

Really all you need is:
net use Y:  \\kisvmapp1\abra_suite

just open notepad and enter that and save it as a .bat file
0
 
HubasanCommented:
If you are not clear on the difference, than you should definitely hit google on that one.

In short, Batch files always have .bat or .cmd extension, while VB Scripts always have .vbs extension.

Batch filles are executed by command interpreter built into all windows OS'es and a batch files are usually a collection commands that use internal or external tools to accomplish a specific task.
Visual basic Script files are textual scripts that are usually written notepad (but can be written in dedicated editor programs) and use COM objects and Windows management instrumentation to access, read and modify system information and are always executed by Windows Scripting Host.

Hope this helps you understand the difference. But as I said you should hit google and get more info since there is A LOT more to both.
0
 
geriatricgeekAuthor Commented:
thanks for the explanation. a quick back of the business card answer helps. google has way too much info and i'm not sure if i could get a brief contrast.  this helps me because i am still new to scripting.
0
 
HubasanCommented:
Hi geriatricgeek,

Thank you for the points and your comments.
Remember, we are here to help you and feel free to ask any questions and we will try our best to help you out as best as we can. Learning scripting is not as hard as some people think it is, but it takes time and lot's of reading. Here is a link that helped me a LOT in learning VB scripting, which I would recommend to you as well since it's more powerful than batch file scripting and gives you the ability to accomplish more with much less scripting:
http://www.microsoft.com/technet/scriptcenter/guide/default.mspx?mfr=true

Good Luck :-)
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now