Bonjour à tous,

J'ai un petit script qui supprime des racourcis si ils sont présent,
puis recréer 2 racourcis.

Cependant, l'emplacement des nouveau racourci pointe l'emplacement des racourcis qui ont été supprimés.

Quand je fait propriété sur le nouveau raccourci, puis emplacement du fichier,
je tombe dans le dossier de mon ancien raccourci qui a été supprimé.

Voici mon code.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Dim Shell
Set Shell = CreateObject("WScript.Shell")
DesktopPath = Shell.SpecialFolders("Desktop")
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
Dim nomfichier : nomfichier = "\JAWS 2022"
Dim lieufichier: lieufichier = DesktopPath & nomfichier
If fso.FileExists(lieufichier) Then
		fso.deletefile lieufichier
	End If
nomfichier = "\NVDA"
lieufichier = DesktopPath & nomfichier
If fso.FileExists(lieufichier) Then
		fso.deletefile lieufichier
	End If
Set fso = Nothing
Set Shell = Nothing
Dim DesktopPath, JAWS, NVDA
Set Shell = CreateObject("WScript.Shell")
DesktopPath = Shell.SpecialFolders("Desktop")
Set JAWS = Shell.CreateShortcut(DesktopPath & "\JAWS 2022.LNK")
JAWS.Hotkey = "ALT+CTRL+J"
JAWS.TargetPath = """%ProgramFiles%\Freedom Scientific\JAWS\2022\jfw.exe"""
JAWS.WorkingDirectory = """%ProgramFiles%\Freedom Scientific\JAWS\2022"""
JAWS.Save
Set NVDA = Shell.CreateShortcut(DesktopPath & "\NVDA.LNK")
NVDA.Hotkey = "ALT+CTRL+N"
NVDA.TargetPath = """%ProgramFiles%\NVDA\nvda.exe"""
NVDA.WorkingDirectory = """%ProgramFiles%\NVDA"""
NVDA.Save
		wscript.echo "terminé!"