Create url shortcut on desktop using WiseScript.
[/align]
0 Comments
[ + ] Show comments
Answers (21)
Please log in to answer
Posted by:
turbokitty
13 years ago
Posted by:
michaelnowell
13 years ago
I would simply just create the .url itself on the desktop.
A .url is simply an .ini file.
Simply create a file called %filename%.url with the following ini lines
[InternetShortcut]
URL=http://www.appdeploy.com
Alternatively, if you're using Windows Installer Editor (within Wise) you can just add this to the ini file table
A .url is simply an .ini file.
Simply create a file called %filename%.url with the following ini lines
[InternetShortcut]
URL=http://www.appdeploy.com
Alternatively, if you're using Windows Installer Editor (within Wise) you can just add this to the ini file table
Posted by:
shalinispillai
13 years ago
If you want to check if the url already exists using wise script editor, u may use the "check if file\dir exists" option and exit the installation.
here is a vb script which will create the desktop url:
On Error Resume Next
Set objShell = WScript.CreateObject("WScript.Shell")
strDesktopFolder = objShell.SpecialFolders("AllUsersDesktop")
Set objShortCut = objShell.CreateShortcut(strDesktopFolder & _
"\Appdeploy.lnk")
objShortCut.TargetPath = chr(34) & "http://www.appdeploy.com" & chr(34)
ObjShortCut.IconLocation = ", 0"
objShortCut.WorkingDirectory = "http://www.appdeploy.com"
objShortCut.Save
hope this works!
here is a vb script which will create the desktop url:
On Error Resume Next
Set objShell = WScript.CreateObject("WScript.Shell")
strDesktopFolder = objShell.SpecialFolders("AllUsersDesktop")
Set objShortCut = objShell.CreateShortcut(strDesktopFolder & _
"\Appdeploy.lnk")
objShortCut.TargetPath = chr(34) & "http://www.appdeploy.com" & chr(34)
ObjShortCut.IconLocation = ", 0"
objShortCut.WorkingDirectory = "http://www.appdeploy.com"
objShortCut.Save
hope this works!
Posted by:
dj_xest
13 years ago
Posted by:
ramesh111k
13 years ago
If you want a wise script, I can help you out in some way. Please check if this helps in solving your issue.
1. Use "Set variable" option and give variable as URLVERSION
2. Use "Set variable" option and give variable as SHORTCUTPATH and value "C:\Documents and Settings\All Users\Desktop"
3. Use "If File Exists" and give pathname is "%SHORTCUTPATH%\xxx.url" and give some text in title and some message in message text.
4. Use "Else" option
5. Use "Create shortcut" option. (not sure whether this option works for you because you have to give the source path) or Use "Install file" option to copy the shortcut from this compiled exe to distination.
Hope this helps your issue or requirement.
Regards
Ramesh
1. Use "Set variable" option and give variable as URLVERSION
2. Use "Set variable" option and give variable as SHORTCUTPATH and value "C:\Documents and Settings\All Users\Desktop"
3. Use "If File Exists" and give pathname is "%SHORTCUTPATH%\xxx.url" and give some text in title and some message in message text.
4. Use "Else" option
5. Use "Create shortcut" option. (not sure whether this option works for you because you have to give the source path) or Use "Install file" option to copy the shortcut from this compiled exe to distination.
Hope this helps your issue or requirement.
Regards
Ramesh
Posted by:
anonymous_9363
13 years ago
How hard can it be? 'Search for File', 'If' (test variable content), 'Create Shortcut'.
To be perfectly frank - and please take this in the spirit in which it's intended - if you can't work out how to do this from the options in front of you in the Wise editor and the dialogs that result from their selection, then you should really be looking for an alternative career.
BTW, in spite of the practices of vendors who should know better, the Desktop is no place for such shortcuts. Use the Start menu.
To be perfectly frank - and please take this in the spirit in which it's intended - if you can't work out how to do this from the options in front of you in the Wise editor and the dialogs that result from their selection, then you should really be looking for an alternative career.
BTW, in spite of the practices of vendors who should know better, the Desktop is no place for such shortcuts. Use the Start menu.
Posted by:
sourav
13 years ago
Ramesh111k : yes ramesh your comment make sence,
but i tried creating shortcut by shortcut page in WiseScript Editor(ver 9. ) as follows :
create shortcut page:
Source Path : www.appdeploy.com
Destination Path : %ALLUSERSPROFILE%\DESKTOP\appdeploy.url
command Options : null
Default Directory : %allusersprofiles%
Description : null
Icon pathname : path\xx\
by this am not able to create shortcut.
Am i doing right?
Members please correct me.
Thanks,
Posted by:
anonymous_9363
13 years ago
Posted by:
shalinispillai
13 years ago
Hi,
As mentioned above, u need to declare the environment variable. Follow the steps below:
1. Select "Get Environment Variable" option in WSE, and enter "ALLUSERSPROFILE" and store it in any variable name . eg:"ALLUSERSPROFILE"
2. Select "Create Shortcut" option and give the following options:
Source Path :http://www.appdeploy.com
Destination Path : %ALLUSERSPROFILE%\Desktop\appdeploy.lnk
command Options : null
Default Directory : %ALLUSERSPROFILE%
Description : Appdeploy
As mentioned above, u need to declare the environment variable. Follow the steps below:
1. Select "Get Environment Variable" option in WSE, and enter "ALLUSERSPROFILE" and store it in any variable name . eg:"ALLUSERSPROFILE"
2. Select "Create Shortcut" option and give the following options:
Source Path :
Destination Path : %ALLUSERSPROFILE%\Desktop\appdeploy.lnk
command Options : null
Default Directory : %ALLUSERSPROFILE%
Description : Appdeploy
Posted by:
sourav
13 years ago
i did as you mentioned , but it is not creating shortcut on desktop.
Thanks for your further help.
Thanks
Posted by:
shalinispillai
13 years ago
Posted by:
turbokitty
13 years ago
Posted by:
sourav
13 years ago
Yes shalinispillai, i did same..
item: Get Environment Variable
Variable=ALLUSERSPROFILE
Environment=ALLUSERSPROFILE
end
item: Create Shortcut
Source=http:\\www.appdeploy.com
Destination=%ALLUSERSPROFILE%\Desktop\appdeploy.url
Working Directory=%ALLUSERSPROFILE%
Description=appdeploy
Key Type=1536
Flags=00000001
end
but it is not creating shortcut.
item: Get Environment Variable
Variable=ALLUSERSPROFILE
Environment=ALLUSERSPROFILE
end
item: Create Shortcut
Source=http:\\www.appdeploy.com
Destination=%ALLUSERSPROFILE%\Desktop\appdeploy.url
Working Directory=%ALLUSERSPROFILE%
Description=appdeploy
Key Type=1536
Flags=00000001
end
but it is not creating shortcut.
Posted by:
elgwhoppo
13 years ago
Not sure why you'd use WiseScript for something this simple. Here's a VBScript that does exactly what you want.
If the file doesn't exist, it makes it. Take out the IF and END if you want it to overwrite.
Set sho = Wscript.CreateObject("Wscript.Shell")
Set fso = wscript.CreateObject("Scripting.FileSystemObject")
strAllUsersProfile = sho.expandenvironmentstrings("%AllUsersProfile%")
If NOT fso.fileexists (strAllUsersProfile & "\Desktop\Appdeploy.URL") then
Set oLink = fso.CreateTextFile(strAllUsersProfile & "\Desktop\Appdeploy.URL", True)
oLink.WriteLine("[InternetShortcut]")
oLink.WriteLine("URL=http://www.appdeploy.com")
oLink.Close
End If
If the file doesn't exist, it makes it. Take out the IF and END if you want it to overwrite.
Set sho = Wscript.CreateObject("Wscript.Shell")
Set fso = wscript.CreateObject("Scripting.FileSystemObject")
strAllUsersProfile = sho.expandenvironmentstrings("%AllUsersProfile%")
If NOT fso.fileexists (strAllUsersProfile & "\Desktop\Appdeploy.URL") then
Set oLink = fso.CreateTextFile(strAllUsersProfile & "\Desktop\Appdeploy.URL", True)
oLink.WriteLine("[InternetShortcut]")
oLink.WriteLine("URL=http://www.appdeploy.com")
oLink.Close
End If
Posted by:
elgwhoppo
13 years ago
No problem, glad it helped.
I usually prefer VB script to Wise because it's native to the OS, a easier to incorporate WMI queries and opens with notepad.
Plus you can't decompile a wisescript. It can be really annoying to come across a wisescript with no corresponding .WSE file. I started out with Wise and mvoed up to VB.
I usually prefer VB script to Wise because it's native to the OS, a easier to incorporate WMI queries and opens with notepad.
Plus you can't decompile a wisescript. It can be really annoying to come across a wisescript with no corresponding .WSE file. I started out with Wise and mvoed up to VB.
Posted by:
anonymous_9363
13 years ago
- Please don't hijack threads. As this is a scripting question, please start a new thread in the 'Scripting' forum. http://www.appdeploy.com/messageboards/tt.asp?forumid=6&p=&tmode=1&smode=1
- Please use the CODE tags when posting code (or lengthy text). You can access the tag by clicking the button marked '<%' in the 'Post New Thread' or 'Reply to Message' windows.
- Please use the CODE tags when posting code (or lengthy text). You can access the tag by clicking the button marked '<%' in the 'Post New Thread' or 'Reply to Message' windows.
Posted by:
MSIPackager
13 years ago
Posted by:
XpressMusic
13 years ago
I know nothing much abt VB and trying to learn so please consider me as trainee and help with the below problems :)
I do know how to open a URL using a VB script but the problem is cant enter the username, password and login automatically can you help with me that. Below is the pasted example script let me know if its my bad
set IE=CreateObject("InternetExplorer.application")
IE.Visible=TRUE
IcUrl="http:\\www.gmail.com"
SetUsr = InputBox("Please Enter Your Username")
SetPas = InputBox("Please Enter Your Password")
IE.Navigate(IcUrl)
'IE.quit
'Set IE=Nothing
I do know how to open a URL using a VB script but the problem is cant enter the username, password and login automatically can you help with me that. Below is the pasted example script let me know if its my bad
set IE=CreateObject("InternetExplorer.application")
IE.Visible=TRUE
IcUrl="http:\\www.gmail.com"
SetUsr = InputBox("Please Enter Your Username")
SetPas = InputBox("Please Enter Your Password")
IE.Navigate(IcUrl)
'IE.quit
'Set IE=Nothing

so that the conversation will remain readable.