Solved

Can I have a vbscript

Posted on 2011-02-15
9
501 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

929 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

16 Experts available now in Live!

Get 1:1 Help Now