Improve company productivity with a Business Account.Sign Up

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

Can I have a vbscript

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
Habib Z
Asked:
Habib Z
  • 5
  • 2
  • 2
1 Solution
 
NoduzzCommented:
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
 
Habib ZNetwork AnalystAuthor Commented:
I m not writing any environmental variable just reading
0
 
Habib ZNetwork AnalystAuthor Commented:
I m not writing any environmental variable just reading
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
NoduzzCommented:
Sorry right i just noticed that, well the link has info on reading as well.
0
 
RobSampsonCommented:
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
 
Habib ZNetwork AnalystAuthor Commented:
RobSamson,

It does not work. I get an error
 vbs error
0
 
Habib ZNetwork AnalystAuthor Commented:
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
 
RobSampsonCommented:
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
 
Habib ZNetwork AnalystAuthor Commented:
Excellent
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

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