• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 545
  • 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 Zakaria
Asked:
Habib Zakaria
  • 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 ZakariaNetwork Solutions ArchitectAuthor Commented:
I m not writing any environmental variable just reading
0
 
Habib ZakariaNetwork Solutions ArchitectAuthor Commented:
I m not writing any environmental variable just reading
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
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 ZakariaNetwork Solutions ArchitectAuthor Commented:
RobSamson,

It does not work. I get an error
 vbs error
0
 
Habib ZakariaNetwork Solutions ArchitectAuthor 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 ZakariaNetwork Solutions ArchitectAuthor 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

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

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