Solved

Can I have a vbscript

Posted on 2011-02-15
9
492 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
  • 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
 
LVL 5

Expert Comment

by:Noduzz
ID: 34900868
Sorry right i just noticed that, well the link has info on reading as well.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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 500 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 Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now