Set AssetBundle name in Asset Labels of an folder

How to edit AssetBundle name of an folder, using C# ?

This can be done by simply selecting it from drop down list, but i would like to automate this…

Here is an SS

AssetImporter assetImporter = AssetImporter.GetAtPath(“Assets/Meshes/Maps/LevelName.unity”);
assetImporter.assetBundleName = “myLevel-scene”;
assetImporter.SaveAndReimport();

Use AssetImporter.GetAtPath. This method works for directory.

string assetPath = AssetDatabase.GetAssetPath(yourGameObject);
AssetImporter.GetAtPath(assetPath).SetAssetBundleNameAndVariant(“somebundlename”, “”);