?
Solved

Can I have a vbscript

Posted on 2011-02-15
9
Medium Priority
?
538 Views
Last Modified: 2012-05-11
I have this batch file but I want to change it to vbscript

@echo off
Set ESRI_Software_class=editor
"c:\program files (x86)\Arcgis\desktop10.0\armap.exe
0
Comment
Question by:Zak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
9 Comments
 
LVL 5

Expert Comment

by:Noduzz
ID: 34900382
It looks like you want to set an environment variable please see this page on setting environments variables:
http://www.robvanderwoude.com/vbstech_data_environment.php
0
 

Author Comment

by:Zak
ID: 34900811
I m not writing any environmental variable just reading
0
 

Author Comment

by:Zak
ID: 34900812
I m not writing any environmental variable just reading
0
Industry Leaders: 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!

 
LVL 5

Expert Comment

by:Noduzz
ID: 34900868
Sorry right i just noticed that, well the link has info on reading as well.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 34902937
Hi, in a not so pure VBS way, you can just to this.

Regards,

Rob.
Set objShell = CreateObject("WScript.Shell")
objShell.Run "cmd /c Set ESRI_Software_class=editor", 0, True
objShell.Run "c:\program files (x86)\Arcgis\desktop10.0\armap.exe", 1, False

Open in new window

0
 

Author Comment

by:Zak
ID: 34903288
RobSamson,

It does not work. I get an error
 vbs error
0
 

Author Comment

by:Zak
ID: 34903294
On another thought how can I have the vbs just recall the batch file. Lets say the batch file is on C:\test.bat

and I want the this vbs to run the batch file.
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 2000 total points
ID: 34903332
Are you sure the file path is correct?  Try this:

 
strEXE = "c:\program files (x86)\Arcgis\desktop10.0\armap.exe"
Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
objShell.Run "cmd /c Set ESRI_Software_class=editor", 0, True
objShell.Run objFSO.GetFile(strEXE).ShortPath, 1, False

Open in new window


Or, to run the batch file, use this:

 
strBatch = "C:\Test.bat"
Set objShell = CreateObject("WScript.Shell")
objShell.Run strBatch, 0, True

Open in new window


Regards,

Rob.
0
 

Author Closing Comment

by:Zak
ID: 34903712
Excellent
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question