Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Using enviroment variables in a path.


Reply
 
Thread Tools Display Modes
  #1  
Old 03-29-2003, 05:27 PM
Viperchief Viperchief is offline
Centurion
 
Join Date: Mar 2003
Location: USA
Posts: 170
Exclamation Using enviroment variables in a path.


You see, im making a shortcut toolbar, and Im putting things in the windows directory in them. I want to run paint.exe and others.
So how can I do this using the variable:
Shell (%windir% / paint.exe) doenst work, what will?
Viperchief
EDIT add a system32 in there

Last edited by Viperchief; 03-29-2003 at 05:36 PM.
Reply With Quote
  #2  
Old 03-29-2003, 05:38 PM
Squirm's Avatar
Squirm Squirm is offline
Political Coder

Retired Moderator
* Guru *
 
Join Date: Mar 2001
Location: London, England
Posts: 8,037
Default

Code:
Shell Environ("windir") & "\paint.exe"
__________________
Search the forums | Use [vb][/vb] tags | Still IRCing
Reply With Quote
  #3  
Old 03-29-2003, 05:38 PM
Viperchief Viperchief is offline
Centurion
 
Join Date: Mar 2003
Location: USA
Posts: 170
Default

how can i add a system 32 in there
Reply With Quote
  #4  
Old 03-29-2003, 05:44 PM
Viperchief Viperchief is offline
Centurion
 
Join Date: Mar 2003
Location: USA
Posts: 170
Default

also, on different win systems its different things
heres what I have and it doesnt work:
Code:
Shell Environ("windir") & "\system32\" & "mspaint.exe" Else Shell Environ("windir") & "\" & "mspaint.exe"
Reply With Quote
  #5  
Old 03-29-2003, 05:52 PM
Squirm's Avatar
Squirm Squirm is offline
Political Coder

Retired Moderator
* Guru *
 
Join Date: Mar 2001
Location: London, England
Posts: 8,037
Default

__________________
Search the forums | Use [vb][/vb] tags | Still IRCing
Reply With Quote
  #6  
Old 03-29-2003, 05:54 PM
Squirm's Avatar
Squirm Squirm is offline
Political Coder

Retired Moderator
* Guru *
 
Join Date: Mar 2001
Location: London, England
Posts: 8,037
Default

However, due to the way Windows looks for files, this should work:

Code:
Shell "mspaint.exe"
__________________
Search the forums | Use [vb][/vb] tags | Still IRCing
Reply With Quote
  #7  
Old 03-29-2003, 05:56 PM
Viperchief Viperchief is offline
Centurion
 
Join Date: Mar 2003
Location: USA
Posts: 170
Default

ok thanks, its now CLOSED
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Declaring Variables in Excel VBA so the values stick EACutter Word, PowerPoint, Outlook, and Other Office Products 2 03-05-2003 12:22 AM
ADODB, Path and Access 2000 problems gogo Database and Reporting 5 01-29-2002 12:43 PM
APP Path Problem CTDana General 2 04-14-2001 09:29 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->