Title: Message
I read somewhere within the NAnt or NAntContrib mailing lists
that it was mentioned to put the _vbscript_ batch file into
an NAnt build file.  So, it must be able to be done somehow.
I do not know how to convert the _vbscript_ code into a VB.NET code.
I am not familiar with _vbscript_ enough. 
 
Can you tell me what the different language options mean for
VJS, vjs, and is the VB and vb for visual basic 6.0 or .NET?
 
Here are some _vbscript_'s examples I found to use as examples to create
shortcuts that I would like to try to embed into my NAnt build script
rather than using the NAnt exec task.
 
1. create desktop shortcut to activate notepad and use a special icon
 
Set WshShell = CreateObject("Wscript.shell")
strDesktop = WshShell.SpecialFolders("Desktop")
Set oMyShortcut = WshShell.CreateShortcut(strDesktop + "\Sample.lnk")
oMyShortcut.WindowStyle = 3  '&&Maximized 7=Minimized  4=Normal
oMyShortcut.IconLocation = "C:\myicon.ico"
OMyShortcut.TargetPath = "%windir%\notepad.exe"
oMyShortCut.Hotkey = "ALT+CTRL+F"
oMyShortCut.Save
 
2.  create a desktop shortcut for a internet website, passing 2 parameters to the
    script.  To run, wscript test2.vbs  Microsoft  http://www.microsoft.com where the first
      parameter is just a name and the second parameter is the actual internet url.
 
Set ArgObj = WScript.Arguments
Set WshShell = CreateObject("WScript.Shell")
strDesktopPath = WshShell.SpecialFolders("Desktop")
urlname = ArgObj(1)
Set objShortcutUrl = WshShell.CreateShortcut(strDesktopPath & "\" & urlname & ".url")
objShortcutUrl.TargetPath = ArgObj(2)
objShortcutUrl.Save
 
3.  Same as #2 to create desktop shortcut but hardcoding the values.
 
WshShell = CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
oUrlLink = WshShell.CreateShortcut(strDesktop+"\Microsoft Web Site.URL")
oUrlLink.TargetPath = "http://www.microsoft.com"
oUrlLink.Save
 
4.  Create a shortcut and place it within a file folder.
 
'Create a WshShell Object
Set WshShell = Wscript.CreateObject("Wscript.Shell")
 
'Create a WshShortcut Object
Set oShellLink = WshShell.CreateShortcut("aaa.lnk")
 
'Set the Target Path for the shortcut
oShellLink.TargetPath = "notepad.exe"
 
'Set the additional parameters for the shortcut
oShellLink.Arguments = "c:\windows\desktop\aaa.txt"
 
'Save the shortcut
oShellLink.Save
 
'Clean up the WshShortcut Object
'Set oShellLink = Nothing
Christina Crawford

 -----Original Message-----
From: Crawford, Christina
Sent: Wednesday, March 15, 2006 3:57 PM
To: 'Andy Johnstone'
Subject: RE: [NAnt-users] Put _vbscript_ batch file code within NAnt

I am currently trying to replace an MSI folder setup project process developed
within Visual Studio for VB .NET 2003 that is in the same solution as the
original application using NAnt or NAntContrib.  I have to
do this because we are giving out our application to Trading Partners and can't
give out MSI files.  I don't understand the MSM and MSI tasks/functions.
All I have to do is it build the projects to create the dll's and put them
and some other documents into a Program Files .  Then, create desktop shortcuts.
Then create another file folder to put into the Start Programs area and place
three shortcuts there.
 
I can do the build OK but can't figure out how to create the shortcuts.
I searched the internet and MSDN and found some _vbscript_ code that work
great.  I can call them using the NAnt exec task but would to embed
them into the NAnt build file.
 
I am trying to create desktop shortcuts and also shortcuts to go within
a Program Files folder using NAnt or NAntContrib functions/tasks.  I could
not find one. 
 
Christina Crawford
-----Original Message-----
From: Andy Johnstone [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 15, 2006 3:35 PM
To: Crawford, Christina
Subject: RE: [NAnt-users] Put _vbscript_ batch file code within NAnt

Don't think you can embed _vbscript_ into the build, but you could certainly call it.
 
Perhaps a better idea would be to use vb.net by using script task.  See if this will help you accomplish your task:  http://nant.sourceforge.net/release/latest/help/tasks/script.html
 
HTH
Andy
 
-----Original Message-----
From: Crawford, Christina [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 15, 2006 3:15 PM
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] Put _vbscript_ batch file code within NAnt

How would one go about including _vbscript_ batch file code and
Embedding it within an Nant build file?  Can Nant script task
Be used in some way?  I would also like to pass parameters into the
Embedded code and receive parameters out of the embedded code. 
I currently am working on just using the Nant exec task to execute
The existing _vbscript_.  I have to figure out how to pass parameters into
The Nant exec task into the _vbscript_ batch file and receive parameters
Back to save to an Nant project name for use later in the Nant build file. 


Reply via email to