473,320 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Call VB script using c++ program

22
Hi all,

I have googled and used about every search enginge I know of but came up with no results for this. I created a small C++ program to call a vbscript on a remote pc as well as write/append to a log file on local machine. Everything works fine except for me not having any code/syntax to call vbscript. If someone could lead me to a resource or reply if they have done it before, I would sincerely appreciate. Thanks to all in advance.
May 24 '07 #1
5 3137
sicarie
4,677 Expert Mod 4TB
Hi all,

I have googled and used about every search enginge I know of but came up with no results for this. I created a small C++ program to call a vbscript on a remote pc as well as write/append to a log file on local machine. Everything works fine except for me not having any code/syntax to call vbscript. If someone could lead me to a resource or reply if they have done it before, I would sincerely appreciate. Thanks to all in advance.
Have you looked into the system() command?
May 25 '07 #2
Lloydm
22
Have you looked into the system() command?

Thanks for replying but no, I have not looked into it. Any resources you have or may know of would be a plus to increase my knowledge? pLease share. Thanks in advance
May 30 '07 #3
Lloydm
22
Still searchine... Anyone?
Jun 2 '07 #4
sicarie
4,677 Expert Mod 4TB
Still searchine... Anyone?
Did you look at the link I sent? You said you hadn't look into it, but did you after I posted it? The system command should be able to do what you want.
Jun 3 '07 #5
Lloydm
22
Did you look at the link I sent? You said you hadn't look into it, but did you after I posted it? The system command should be able to do what you want.

OK, I wanna say thanks a million. program is working.
To all here's sample code


#include<iostream>
using namespace::std;

string answer="1";

int main(){
do{
cout<<"\n\n Press 1 to browse the internet?: ";
cin >>answer;

if(answer == "1"){
cout<<"\n\n Please wait..."
<<"\n Opening Notepad, please wait.....\n";
//EXECUTE NOTEPAD
system("C:\\Windows\\Notepad.exe");

//LIST FOLDER CONTENTS
system("cls");
system("dir c:\\windows\\system");

//CREATE A DIRECTORY
system("cls");
cout<<"\n\n Creating directory 'USERS', please wait...";
system("mkdir Users");

cout<<"\n\n Program will now exit...\n"
<<" ";
system("pause");
exit(1);
}
else{
cout<<"\n " <<answer
<<" is not a valid answer, try again\n";
fflush(stdin);
cout<<" ";
system("pause");
system("cls");
}
}while(answer!="1");
return 0;
}
Jun 6 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jimmy Jim | last post by:
Hey all, quick question to see if anyone has any ideas. I have an object: $special = new special; Let's say I have a function: class special { function outputtext() { return "test";
2
by: Greg Chapman | last post by:
I am at my wit's end trying to get information out of Streamline.net's support dept about my problem. They reply quickly enough, but seem to try and give out the least possible amount of info each...
3
by: Tubby Tudor | last post by:
What is the best way to call one python script from within another python script? For example: one.py finishes succesfully and calls two.py which finishes OK and then calls three.py Thanks...
15
by: chirs | last post by:
I am trying to understand a piece of code. In a javascrpit file, there is a function: function ItemStyle(){ var names=; addProps(this,arguments,names,true); }; In the html file, it calls...
1
by: Michael | last post by:
Hello, Not sure if this is the right message board but I have an interesting problem. Using Visual Studio .NET, C++, I want to write an all-encompassing C++ program to download new files from...
8
by: Jade | last post by:
I saw some web page saying I could do it this way in javascript: var iNumber = <%#publicvarname publicpropertyname %> but it doesn't seem to work. I have this piece of code here in...
4
by: Dave | last post by:
I have a program that I've written a class for. I need to call the function in the program from the class. When I try to call the function I receive the error, the name xxx does not exist in the...
13
by: Larry Menard | last post by:
Test code: $dbconn = odbc_connect($dbname, $username, $password); $path = "C:\Temp\myJar.jar"; $statement = "CALL SQLJ.INSTALL_JAR('file://$path', 'myJarId')"; $result = odbc_exec($dbconn,...
5
by: Ham | last post by:
Hi I am looking for a function call tree program to map the function calls of my project. I however do not want to compile my project. All the programs I have found for this require you to...
1
by: vocalise | last post by:
The title probably isn't very clear, but I haven't been able to find this problem (or I must be having problems figuring out which search strings to use) so I apologize if this has been addressed...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.