cancel
Showing results for 
Search instead for 
Did you mean: 

740 - Delete NWBC Desktop Link

maryjane_steele2
Active Participant
0 Kudos

I have decided to roll-out NWBC with the 740 GUI but would like to delete the desktop link for NWBC and keep the Logon Pad.  The environment variable %USERPROFILE% does not seem to work, any suggestions on how to accomplish this?

Accepted Solutions (1)

Accepted Solutions (1)

maryjane_steele2
Active Participant
0 Kudos

In case anyone encounters this issue.  I opened a ticket with SAP and was told that there is no indication that PROGAMDATA was supported with the resolve string.  To resolve my original problem which was deleting the NWBC desktop link I delete "C:\Users\Public\NetWeaver Business Client 5.0.lnk"

Answers (1)

Answers (1)

roybrasse
Explorer
0 Kudos

On Windows 7...

The icons should be in:

1. - %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\NetWeaver Business Client 4.0.lnk

2. - C:\Users\Public\Desktop\NetWeaver Business Client 4.0.lnk

Thanks,

Roy

maryjane_steele2
Active Participant
0 Kudos

Unfortunately NWEngine shell scripts do not seem able to translate %PROGRAMDATA% either.

Matt_Fraser
Active Contributor
0 Kudos

Hmm, that seems like a bug. NWEngine shell scripts should definitely translate system variables like that. I use %USERPROFILE%, and others, though not %PROGRAMDATA%, in my scripts just fine. However, I am using the 7.30 sapsetup, not 7.40. Have you used these variables in scripts successfully before?

maryjane_steele2
Active Participant
0 Kudos

No this is the first time I have used them.  I guess I'll open a ticket.

roybrasse
Explorer
0 Kudos

I have the NWEngine successfully working with the two paths shown below.  Also 730, have not started scripting 740 yet.

strDstFileSAPLogonPad1  = "%PUBLIC%\Desktop\SAP Logon Pad.lnk"

strDstFileSAPLogonPad2  = "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\SAP Front End\SAP Logon Pad.lnk"

Roy

Matt_Fraser
Active Contributor
0 Kudos

Before you do that, let's make sure you are using them correctly in your script. You can't just put the variable into a string directly; you have to resolve it. For instance:

Set strFile = "%USERPROFILE%\AppData"

won't work. However,

strFile = NwEngine.Variables.ResolveString( "%USERPROFILE%\AppData" )

will.

maryjane_steele2
Active Participant
0 Kudos

I am trying 

strDelFile = NwEngine.Variables.ResolveString("%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\NetWeaver Business Client 5.0.lnk")

NwEngine.Shell.DeleteFile strDelFile

When the delete command run it just tries to delete 'Microsoft\Windows\Start Menu\Programs\NetWeaver Business Client 5.0.lnk'

Matt_Fraser
Active Contributor
0 Kudos

That should work. I have a space between the open or close parenthesis and the quote, but I'm not sure that matters (but, anything's worth a try, right?). The other thing I would check is to open a command prompt on the workstation where you are testing the install and type SET with no parameters. Make sure that PROGRAMDATA shows up with a value. Or ProgramData, as it shows up for me, but I don't think case-sensitivity is an issue.

Is the install running as the enduser (i.e., yourself in your testing), or are you using Local Security Handling? If the latter, try logging on as the LSH user you've configured in NwSapSetupAdmin and make sure the environment variables show up properly for that user, too.

Also, have you checked for errors through the install logs? You can find them on the workstation at C:\Program Files (x86)\SAP\SapSetup\LOGs.

maryjane_steele2
Active Participant
0 Kudos

I did have a space between the open quote and removed it thinking that was the problem.  Alas it was not.  I am not using LSH, trying to avoid it.  And yes I have looked at the logs, that is how I know that the variable is not being resolved.  In fact I ran a test where I just tried printing out the variable.  I am at the point where I will be opening a ticket with SAP.  Thanks for your help!

strzFile = NwEngine.Variables.ResolveString("%PROGRAMDATA%")

NwEngine.Context.Log.Write "*** Program Data is " & Chr(34) & strzFile & Chr(34)

Matt_Fraser
Active Contributor
0 Kudos

Ok, then, definitely looks like a bug to me. Good troubleshooting!