473,406 Members | 2,281 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,406 software developers and data experts.

Using VBS to open a program in XP

23
Someone suggested a while back that I should use VBscript shell to open programs in windows XP and set them in specific locations on the desktop with specific window sizes. However, I have never worked with vbscript before, and do not understand it at all. I'm pretty quick to pick things up though, and if I saw an example of a VBS startup script, I could adapt it for my needs. Can anyone point me to a working vbs script that starts a program in windows xp?
Apr 26 '08 #1
3 2674
kadghar
1,295 Expert 1GB
Someone suggested a while back that I should use VBscript shell to open programs in windows XP and set them in specific locations on the desktop with specific window sizes. However, I have never worked with vbscript before, and do not understand it at all. I'm pretty quick to pick things up though, and if I saw an example of a VBS startup script, I could adapt it for my needs. Can anyone point me to a working vbs script that starts a program in windows xp?
Hi, sure...

First of all, make sure the Shell command is in a Sub procedure, then just run it. Its quite simple,

Note that Shell will return a Double (a number), this number is your program ID.

Expand|Select|Wrap|Line Numbers
  1. Sub forZ1P2()
  2. Dim a As Double
  3. a = Shell("c:\windows\notepad.exe", 1)
  4. End Sub
now, you have notepath open, and 'a' has its ID.

well, i hope that helps.
Apr 28 '08 #2
Z1P2
23
I don't understand how that sets the specific window location and size on the desktop when the program is launched...
Jun 26 '08 #3
kadghar
1,295 Expert 1GB
I don't understand how that sets the specific window location and size on the desktop when the program is launched...
the second parameter of shell will set the windows size, i used the numeric value ('1'), but there are constants easier to remember.

once you have the handler number ('a') you can easily work with it.
Jun 26 '08 #4

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

Similar topics

11
by: Johnny Lee | last post by:
Hi, I was using urllib to grab urls from web. here is the work flow of my program: 1. Get base url and max number of urls from user 2. Call filter to validate the base url 3. Read the source...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
6
by: hpy_awad | last post by:
I am writing stings ((*cust).name),((*cust).address)to a file using fgets but rabish is being wrote to that file ? Look to my source please and help me finding the reason why this rabish is being...
3
by: ehabaziz2001 | last post by:
I know one of the pointer benefit is that we can return more than one value from a function . The down program has an error that I can not discover . That is the call of the function : The Call:...
2
by: Gos | last post by:
Hi, I have a program that needs to open a list of attachments displayed on a ListView. I have used Process.Start method to open the files using their associated program. This works correctly if...
16
by: Asaf | last post by:
I am trying to create and use a COM object with C#.NET 2005. The assembly is set to "Register for COM interop" but when I am trying to call it from VB on Word 2003 I am getting this error: ...
0
by: erkidevries | last post by:
Problem compiling Tkinter program with bmp images (using py2exe) I have a Tkinter gui program that uses bmp as backgrounds. The program itself works when I run from the source. I placed the...
2
by: OutdoorGuy | last post by:
Greetings, I have a "newbie" question in relation to opening files from C#. I have a Windows form where I allow the user to type in a file extension in a text box (e.g., "xls"). I then take...
0
MrMancunian
by: MrMancunian | last post by:
How to create a database connection without using wizards Introduction I've seen a lot of questions on the net about getting data from, and saving data to databases. Here's a little insight how...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.