Need a VBScript, I have batch script that execute an application install which takes 30 minutes to install, at the end of this install I need to delete start menue shortcut
Hi Everyone, I need help creating a vbscript that remvoes the shortcuts folders from "%ALLUSERSPROFILE%\StartM~1\Programs\lotusn~1" after they are created or untill the install process is done. I have tried my batch script with start /wait of my install doesnt work. So if I have a VBScript that looks for the runing process or monitor when these shortcuts are created will work. Here is my batch file
myapplocation\setup.exe
IF EXIST "%ALLUSERSPROFILE%\StartM~1\Programs\lotusn~1 rmdir" "%ALLUSERSPROFILE%\StartM~1\Programs\lotusn~1" /s /q
IF EXIST "%ALLUSERSPROFILE%\StartM~1\Programs\lotusm~1 rmdir" "%ALLUSERSPROFILE%\StartM~1\Programs\lotusm~1" /s /q
Answers (2)
If you are creating a vbscript this has to be tricky you need to loop sleep counter till the folder is deleted as shown in the below snippet:
Dim counter
counter = 0
Do While fso.FolderExists(DelFoldername) And counter < 10
WScript.Sleep 1000
counter = counter + 1
Loop
If fso.FolderExists(DelFolderName) Then
' Write a failure message.
End If
Comments:
-
Thanks for the help, I didnt have to write a script, I end up using application launcher script to remove those folders. Thanks - sam42856 12 years ago